Fix: report truncation on snprintf
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 7 Sep 2016 15:54:40 +0000 (11:54 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Oct 2016 04:44:05 +0000 (00:44 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/uri.c

index 58ffcbcd66de518c8fba4ee4c470609af5ec8491..380e75dd33b4839b144181c35f341a2724ef0f4e 100644 (file)
@@ -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;
        }
This page took 0.025352 seconds and 4 git commands to generate.