projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b61df22
)
regcomp: propagate allocation failures
author
Szabolcs Nagy
<nsz@port70.net>
Wed, 23 Sep 2015 18:19:34 +0000
(18:19 +0000)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 24 Sep 2015 06:33:18 +0000
(
02:33
-0400)
The error code of an allocating function was not checked in tre_add_tag.
src/regex/regcomp.c
patch
|
blob
|
history
diff --git
a/src/regex/regcomp.c
b/src/regex/regcomp.c
index 978dd87f33912d7c097e3cc281bd1479070d7e99..330de46759730b55b90d9080fb7798d37ae5db86 100644
(file)
--- a/
src/regex/regcomp.c
+++ b/
src/regex/regcomp.c
@@
-1584,7
+1584,8
@@
tre_add_tags(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree,
{
status = tre_add_tag_right(mem, left, tag_left);
tnfa->tag_directions[tag_left] = TRE_TAG_MAXIMIZE;
- status = tre_add_tag_right(mem, right, tag_right);
+ if (status == REG_OK)
+ status = tre_add_tag_right(mem, right, tag_right);
tnfa->tag_directions[tag_right] = TRE_TAG_MAXIMIZE;
}
num_tags += 2;