Paranoia check in buffer overun in output function.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21361 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -292,6 +292,11 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
"size_t elen, totallen = 0;\n"
|
||||
"int eret;\n");
|
||||
|
||||
fprintf(codefile,
|
||||
"if ((%s)->len > UINT_MAX/sizeof(val[0]))\n"
|
||||
"return ERANGE;\n",
|
||||
name);
|
||||
|
||||
fprintf(codefile,
|
||||
"val = malloc(sizeof(val[0]) * (%s)->len);\n"
|
||||
"if (val == NULL && (%s)->len != 0) return ENOMEM;\n",
|
||||
|
Reference in New Issue
Block a user