Commits

Kirill Simonov committed 0df2fb9

Limit input size to SIZE_MAX/2.

  • Participants
  • Parent commits f859ed1

Comments (0)

Files changed (2)

File src/reader.c

 
     }
 
+    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

 #include <assert.h>
 #include <limits.h>
 #include <stddef.h>
+#include <stdint.h>
 
 /*
  * Memory management.