From 5fd754c4e25ee16ae527d3f3c76f5114c2de752a Mon Sep 17 00:00:00 2001 From: Daniel Becker Date: Fri, 11 Dec 2015 16:21:32 -0800 Subject: [PATCH] use sizeof() instead of hard-coded UUID length in newSubscriber() --- miniupnpd/upnpevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniupnpd/upnpevents.c b/miniupnpd/upnpevents.c index 628aff8..1013eb1 100644 --- a/miniupnpd/upnpevents.c +++ b/miniupnpd/upnpevents.c @@ -112,7 +112,7 @@ newSubscriber(const char * eventurl, const char * callback, int callbacklen) /* TODO: improve that */ strncpy(tmp->uuid, uuidvalue_igd, sizeof(tmp->uuid)); tmp->uuid[sizeof(tmp->uuid)-1] = '\0'; - snprintf(tmp->uuid+37, 5, "%04lx", random() & 0xffff); + snprintf(tmp->uuid+sizeof(tmp->uuid)-5, 5, "%04lx", random() & 0xffff); return tmp; }