summaryrefslogtreecommitdiff
path: root/src/pcre2_serialize.c
diff options
context:
space:
mode:
authorMatthew Vernon <matthew@debian.org>2018-02-24 12:07:04 +0000
committerMatthew Vernon <matthew@debian.org>2018-02-24 12:07:04 +0000
commite98c3314cf9e05aa99f5e192862ec37f29b7dbb5 (patch)
treeb69bb3feb63a4fd79ad8a6e55865228f6fde04eb /src/pcre2_serialize.c
parent92b17f0eb8fddd7117c5344a1e1177daec21995a (diff)
New upstream version 10.31
Diffstat (limited to 'src/pcre2_serialize.c')
-rw-r--r--src/pcre2_serialize.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pcre2_serialize.c b/src/pcre2_serialize.c
index 0af26d8..d2cc603 100644
--- a/src/pcre2_serialize.c
+++ b/src/pcre2_serialize.c
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
- New API code Copyright (c) 2016 University of Cambridge
+ New API code Copyright (c) 2016-2017 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -214,7 +214,10 @@ for (i = 0; i < number_of_codes; i++)
if (dst_re->magic_number != MAGIC_NUMBER ||
dst_re->name_entry_size > MAX_NAME_SIZE + IMM2_SIZE + 1 ||
dst_re->name_count > MAX_NAME_COUNT)
+ {
+ memctl->free(dst_re, memctl->memory_data);
return PCRE2_ERROR_BADSERIALIZEDDATA;
+ }
/* At the moment only one table is supported. */