Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103819599
D36831.id111251.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
572 B
Referenced Files
None
Subscribers
None
D36831.id111251.diff
View Options
diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -43,6 +43,7 @@
#include <err.h>
#include <ctype.h>
#include <limits.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -370,13 +371,15 @@
getptrs(char **sp)
{
char **p;
+ ptrdiff_t offset;
+ offset = sp - elem;
allocsize += allocsize;
p = (char **)realloc(elem, allocsize * sizeof(char *));
if (p == NULL)
err(1, "no memory");
- sp += (p - elem);
+ sp = p + offset;
endelem = (elem = p) + allocsize;
return(sp);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 8:59 PM (20 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14950327
Default Alt Text
D36831.id111251.diff (572 B)
Attached To
Mode
D36831: rs: Fix a use after free.
Attached
Detach File
Event Timeline
Log In to Comment