From 16aa84a9d47e500a29ed06c929600aa2117a6e80 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Wed, 7 Sep 2016 11:54:40 -0400 Subject: [PATCH] Fix: report truncation on snprintf MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- src/common/uri.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.34.1