handlers.c: added null pointer precaution for copying fields
This commit is contained in:
parent
e4d625c6fa
commit
7d9e96d259
@ -51,6 +51,11 @@ allocField(char **field, char *str)
|
||||
void
|
||||
copyField(itemStruct *item, enum fields field, char *str)
|
||||
{
|
||||
if (!str) {
|
||||
logMsg(1, "Attempted to assign a null pointer to a field!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
allocField(&item->fields[field], str);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user