You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-07-06 23:37:39 +02:00
fix #206, do not allow nil pointer as unmarshal input
This commit is contained in:
@ -233,6 +233,10 @@ func (iter *Iterator) ReadVal(obj interface{}) {
|
||||
return
|
||||
}
|
||||
e := (*emptyInterface)(unsafe.Pointer(&obj))
|
||||
if e.word == nil {
|
||||
iter.ReportError("ReadVal", "can not read into nil pointer")
|
||||
return
|
||||
}
|
||||
decoder.Decode(e.word, iter)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user