From: Jim Meyering Date: Tue, 19 Jan 2010 14:13:16 +0000 (+0100) Subject: regex: do not ignore memory allocation failure X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c592b8e3daf712a1774a457b9d640fc1ff106e70;p=pspp regex: do not ignore memory allocation failure * lib/regex_internal.c (create_cd_newstate): Detect re_node_set_init_copy failure. Extracted from glibc commit 2da42bc06566bc89785e580fa1ac89b4c9f2a63c. --- diff --git a/ChangeLog b/ChangeLog index 20b6ae2cae..c3cb30046b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-01-28 Jim Meyering + regex: do not ignore memory allocation failure + * lib/regex_internal.c (create_cd_newstate): Detect + re_node_set_init_copy failure. Extracted from glibc commit + 2da42bc06566bc89785e580fa1ac89b4c9f2a63c. + regex: sync more white-space changes from libc * lib/regex_internal.c: White-space only changes. * lib/regexec.c: Likewise. diff --git a/lib/regex_internal.c b/lib/regex_internal.c index a116106708..378b767d82 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -1716,7 +1716,9 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, free_state (newstate); return NULL; } - re_node_set_init_copy (newstate->entrance_nodes, nodes); + if (re_node_set_init_copy (newstate->entrance_nodes, nodes) + != REG_NOERROR) + return NULL; nctx_nodes = 0; newstate->has_constraint = 1; }