mirror of
https://github.com/json-c/json-c.git
synced 2026-11-05 21:20:16 +08:00
fix out-of-bounds read for negative errno in _json_c_strerror
This commit is contained in:
1 parent
e65444a258
commit
9d116a5d38
3 files changed
+20
-5
No files matched your search
@@ -9,5 +9,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
puts(strerror(10000));
|
||||
puts(strerror(999));
|
||||
/* Negative values must not index before the digit table (out-of-bounds
|
||||
* read); INT_MIN also exercises the unsigned magnitude handling. */
|
||||
puts(strerror(-5));
|
||||
puts(strerror(-2147483647 - 1));
|
||||
return 0;
|
||||
}
|
||||
@@ -1,2 +1,4 @@
|
||||
ERRNO=10000
|
||||
ERRNO=999
|
||||
ERRNO=-5
|
||||
ERRNO=-2147483648
|
||||
Reference in new issue
Block a user