From 3ab4752c5685a2612135e4c34c9cbdffc1eb3038 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 7 Dec 2020 13:43:46 -0500 Subject: Correctly handle . in nameString --- getservinfo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/getservinfo.c b/getservinfo.c index 0db7bc0..7565ef1 100644 --- a/getservinfo.c +++ b/getservinfo.c @@ -57,7 +57,8 @@ static void nameSkip(uint8_t **ptr) { } static char *nameString(uint8_t **ptr) { - char *name = (char *)(*ptr + 1); + char *name = (char *)*ptr; + if (**ptr) name++; for (uint8_t len; (len = **ptr); *ptr += len) { *(*ptr)++ = '.'; } -- cgit 1.4.1