diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2019-09-30 18:36:00 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2019-09-30 18:36:00 +0200 |
commit | ead26e764920651c96370458a626a954e2997914 (patch) | |
tree | 37a0bf4c382c08a6d32c9edfd8fb4c97e5e42259 /package/flex/patches/patch-src_misc_c | |
parent | 4459d213841ffa2f8a76b32c9f7ce45650f423fc (diff) |
flex: add missing patch
Diffstat (limited to 'package/flex/patches/patch-src_misc_c')
-rw-r--r-- | package/flex/patches/patch-src_misc_c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/package/flex/patches/patch-src_misc_c b/package/flex/patches/patch-src_misc_c new file mode 100644 index 000000000..f5b425c14 --- /dev/null +++ b/package/flex/patches/patch-src_misc_c @@ -0,0 +1,32 @@ +--- flex-2.6.4.orig/src/misc.c 2017-05-03 22:16:37.000000000 +0200 ++++ flex-2.6.4/src/misc.c 2019-09-30 18:07:55.823580183 +0200 +@@ -142,7 +142,14 @@ void add_action (const char *new_text) + void *allocate_array (int size, size_t element_size) + { + void *mem; +-#if HAVE_REALLOCARRAY ++#if HAVE_REALLOCARR ++ mem = NULL; ++ if (reallocarr(&mem, (size_t) size, element_size)) ++ flexfatal (_ ++ ("memory allocation failed in allocate_array()")); ++ ++ return mem; ++#elif HAVE_REALLOCARRAY + /* reallocarray has built-in overflow detection */ + mem = reallocarray(NULL, (size_t) size, element_size); + #else +@@ -659,7 +666,12 @@ char *readable_form (int c) + void *reallocate_array (void *array, int size, size_t element_size) + { + void *new_array; +-#if HAVE_REALLOCARRAY ++#if HAVE_REALLOCARR ++ if (reallocarr(&array, (size_t) size, element_size)) ++ flexfatal (_("attempt to increase array size failed")); ++ ++ return array; ++#elif HAVE_REALLOCARRAY + /* reallocarray has built-in overflow detection */ + new_array = reallocarray(array, (size_t) size, element_size); + #else |