asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6.02k stars 556 forks source link

The govalidator does not support multi-goroutines, multi-goroutines insecurity? #245

Open wpecker opened 6 years ago

wpecker commented 6 years ago

fatal error: concurrent map read and map write

goroutine 2399752 [running]: runtime.throw(0xb2bbd7, 0x21) /mnt/shared/go/src/runtime/panic.go:605 +0x95 fp=0xc60cb5c3c0 sp=0xc60cb5c3a0 pc=0x42d1f5 runtime.mapaccess2_faststr(0xa7d800, 0xc4201b3da0, 0xa124ec, 0x8, 0x0, 0x0) /mnt/shared/go/src/runtime/hashmap_fast.go:324 +0x47a fp=0xc60cb5c418 sp=0xc60cb5c3c0 pc=0x40dbaa innotechx.com/net-copycat-audit/vendor/github.com/asaskevich/govalidator.typeCheck(0xa4a9e0, 0xc677028170, 0x98, 0xa124dc, 0x7, 0x0, 0x0, 0x14eda60, 0xa4a9e0, 0xa124e5, ...) /mnt/shared/go-T/src/innotechx.com/net-copycat-audit/vendor/github.com/asaskevich/govalidator/validator.go:1014 +0x15ff fp=0xc60cb5cc58 sp=0xc60cb5c418 pc=0x84924f innotechx.com/net-copycat-audit/vendor/github.com/asaskevich/govalidator.ValidateStruct(0xab5740, 0xc677028150, 0xab5740, 0xc677028150, 0xc4201198c0) /mnt/shared/go-T/src/innotechx.com/net-copycat-audit/vendor/github.com/asaskevich/govalidator/validator.go:688 +0x34c fp=0xc60cb5d008 sp=0xc60cb5cc58 pc=0x84618c

    ok, err := govalidator.ValidateStruct(req)
    if err != nil || !ok {
         ...
        }
tuan-lm97 commented 3 years ago

Why does this got close without any comment ? I have got the same issue with TagMap

sergeyglazyrindev commented 2 years ago

Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.