projects
/
oweals
/
odhcp6c.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb73c7c
)
Prevent OOM DOS
author
Steven Barth
<steven@midlink.org>
Thu, 31 Jan 2013 07:38:38 +0000
(08:38 +0100)
committer
Steven Barth
<steven@midlink.org>
Thu, 31 Jan 2013 07:38:38 +0000
(08:38 +0100)
src/odhcp6c.c
patch
|
blob
|
history
diff --git
a/src/odhcp6c.c
b/src/odhcp6c.c
index 6a1d1b4bdcc2caae05a79bfeda822f9339c1304d..b5665ee54283d1598a55fe572171f5b376fd74c1 100644
(file)
--- a/
src/odhcp6c.c
+++ b/
src/odhcp6c.c
@@
-317,6
+317,8
@@
static uint8_t* odhcp6c_resize_state(enum odhcp6c_state state, ssize_t len)
{
if (len == 0)
return state_data[state] + state_len[state];
+ else if (state_len[state] + len > 1024)
+ return NULL;
uint8_t *n = realloc(state_data[state], state_len[state] + len);
if (n || state_len[state] + len == 0) {