1. Kirill Simonov
  2. libyaml

Commits

Kirill Simonov  committed 0df2fb9

Limit input size to SIZE_MAX/2.

Comments (0)

Files changed (2)

File src/reader.c Modified

View file
  • Ignore whitespace
  • Hide word diff
 
     }
 
+    if (parser->offset >= PTRDIFF_MAX)
+        return yaml_parser_set_reader_error(parser, "input is too long",
+                PTRDIFF_MAX, -1);
+
     return 1;
 }
 

File src/yaml_private.h Modified

View file
  • Ignore whitespace
  • Hide word diff
 #include <assert.h>
 #include <limits.h>
 #include <stddef.h>
+#include <stdint.h>
 
 /*
  * Memory management.