handlers.c: added null pointer precaution for copying fields

This commit is contained in:
dogeystamp 2023-01-15 21:31:52 -05:00
parent e4d625c6fa
commit 7d9e96d259
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -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);
}