From: Jonathan Rajotte Date: Wed, 7 Sep 2016 15:54:40 +0000 (-0400) Subject: Fix: report truncation on snprintf X-Git-Tag: v2.8.2~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1ef554644ece12b3606ca4071a79436c33fc8d20;p=lttng-tools.git Fix: report truncation on snprintf Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/uri.c b/src/common/uri.c index 58ffcbcd6..380e75dd3 100644 --- a/src/common/uri.c +++ b/src/common/uri.c @@ -587,6 +587,10 @@ ssize_t uri_parse_str_urls(const char *ctrl_url, const char *data_url, if (ret < 0) { PERROR("snprintf file url"); goto parse_error; + } else if (ret >= sizeof(url)) { + PERROR("snprintf file url is too long"); + goto parse_error; + } ctrl_url = url; }