summaryrefslogtreecommitdiff
path: root/ext/psych/yaml/reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/yaml/reader.c')
-rw-r--r--ext/psych/yaml/reader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/psych/yaml/reader.c b/ext/psych/yaml/reader.c
index 4e48add7b8..f1a06deb9d 100644
--- a/ext/psych/yaml/reader.c
+++ b/ext/psych/yaml/reader.c
@@ -460,6 +460,10 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
}
+ if (parser->offset >= PTRDIFF_MAX)
+ return yaml_parser_set_reader_error(parser, "input is too long",
+ PTRDIFF_MAX, -1);
+
return 1;
}