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:
e4f9d81
)
fix tsearch to avoid crash on oom
author
Szabolcs Nagy
<nsz@port70.net>
Sat, 5 Dec 2015 20:04:18 +0000
(21:04 +0100)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 8 Dec 2015 23:52:38 +0000
(18:52 -0500)
malloc failure was not properly propagated in the insertion method
which led to null pointer dereference.
src/search/tsearch_avl.c
patch
|
blob
|
history
diff --git
a/src/search/tsearch_avl.c
b/src/search/tsearch_avl.c
index 08644607abf5192dde18342c493c6f98cd914ecb..8c2f3470ae492f25fc196476fba93fc6376c6430 100644
(file)
--- a/
src/search/tsearch_avl.c
+++ b/
src/search/tsearch_avl.c
@@
-89,8
+89,8
@@
static struct node *insert(struct node **n, const void *k,
r->key = k;
r->left = r->right = 0;
r->height = 1;
+ *new = 1;
}
- *new = 1;
return r;
}
c = cmp(k, r->key);