From 7d9e96d259b222872cc292d179c39b2b584e26e6 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 15 Jan 2023 21:31:52 -0500 Subject: [PATCH] handlers.c: added null pointer precaution for copying fields --- handlers.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handlers.c b/handlers.c index 002c311..d9d7c35 100644 --- a/handlers.c +++ b/handlers.c @@ -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); }