public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5990fcd
)
malloc: do the overflow maths in unsigned
author
Alan Cox
<alan@linux.intel.com>
Tue, 28 Jun 2016 09:46:15 +0000
(10:46 +0100)
committer
Alan Cox
<alan@linux.intel.com>
Tue, 28 Jun 2016 09:46:15 +0000
(10:46 +0100)
Library/libs/malloc.c
patch
|
blob
|
history
diff --git
a/Library/libs/malloc.c
b/Library/libs/malloc.c
index
abe00a4
..
2e567fb
100644
(file)
--- a/
Library/libs/malloc.c
+++ b/
Library/libs/malloc.c
@@
-33,7
+33,7
@@
static struct memh *brkmore(size_t nb)
if (p == (struct memh *) -1)
return NULL;
/* Overflow catch */
- if (
p + nb <
p)
+ if (
(uintptr_t)p + sizeof(struct memh) * nb < (uintptr_t)
p)
return NULL;
/* Move our break point. Using brk this way avoids the sign problems */
if (brk(p + nb))