diff --git a/src/inet.c b/src/inet.c index 4b630f53..cd774968 100644 --- a/src/inet.c +++ b/src/inet.c @@ -130,7 +130,7 @@ static int inet_ntop6(const unsigned char *src, char *dst, size_t size) { tp += strlen(tp); break; } - tp += sprintf(tp, "%x", words[i]); + tp += snprintf(tp, sizeof tmp - (tp - tmp), "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == ARRAY_SIZE(words))