gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 34/153: curl: Fix segfault when -H @headerfile is e


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 34/153: curl: Fix segfault when -H @headerfile is empty
Date: Tue, 11 Sep 2018 12:51:45 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 3e9b3a3798885b31fe316cafa57425f44bcd1a2c
Author: Tobias Blomberg <address@hidden>
AuthorDate: Thu Jul 26 23:22:49 2018 +0200

    curl: Fix segfault when -H @headerfile is empty
    
    The curl binary would crash if the -H command line option was given a
    filename to read using the @filename syntax but that file was empty.
    
    Closes #2797
---
 src/tool_getparam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index cc3fcf3a5..e42a894cb 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -1706,7 +1706,7 @@ ParameterError getparameter(const char *flag, /* f or 
-long-flag */
           warnf(global, "Failed to open %s!\n", &nextarg[1]);
         else {
           err = file2memory(&string, &len, file);
-          if(!err) {
+          if(!err && string) {
             /* Allow strtok() here since this isn't used threaded */
             /* !checksrc! disable BANNEDFUNC 2 */
             char *h = strtok(string, "\r\n");

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]