2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

[master] Corrects high impact issues reported by Coverity.

Merges in rt36712
This commit is contained in:
Thomas Markwalder
2014-08-25 13:22:29 -04:00
parent a6365d17d1
commit 36e2c22493
10 changed files with 73 additions and 65 deletions

View File

@@ -1733,21 +1733,14 @@ class_set_value (omapi_object_t *h,
class = (struct class *)h;
if (!omapi_ds_strcmp(name, "name")) {
char *tname;
if (class->name)
return ISC_R_EXISTS;
if ((tname = dmalloc(value->u.buffer.len + 1, MDL)) == NULL) {
return ISC_R_NOMEMORY;
}
/* tname is null terminated from dmalloc() */
memcpy(tname, value->u.buffer.value, value->u.buffer.len);
if (issubclass) {
char tname[value->u.buffer.len + 1];
memcpy(tname, value->u.buffer.value, value->u.buffer.len);
tname[sizeof(tname)-1] = '\0';
status = find_class(&superclass, tname, MDL);
dfree(tname, MDL);
if (status == ISC_R_NOTFOUND)
return status;