Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146781305
D52151.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
768 B
Referenced Files
None
Subscribers
None
D52151.id.diff
View Options
diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c
--- a/sys/netgraph/ng_parse.c
+++ b/sys/netgraph/ng_parse.c
@@ -1199,14 +1199,14 @@
int *off, const u_char *const start, u_char *const buf, int *buflen,
const enum comptype ctype)
{
- const int num = ng_get_composite_len(type, start, buf, ctype);
int nextIndex = 0; /* next implicit array index */
u_int index; /* field or element index */
int *foff; /* field value offsets in string */
int align, len, blen, error = 0;
/* Initialize */
- if (num < 0)
+ const int num = ng_get_composite_len(type, start, buf, ctype);
+ if (num < 0 || num > INT_MAX / sizeof(*foff))
return (EINVAL);
foff = malloc(num * sizeof(*foff), M_NETGRAPH_PARSE, M_NOWAIT | M_ZERO);
if (foff == NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 6, 1:26 PM (13 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29316877
Default Alt Text
D52151.id.diff (768 B)
Attached To
Mode
D52151: ng_parse: Add upper bound to avoid possible overflow
Attached
Detach File
Event Timeline
Log In to Comment