gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnurl] 33/153: mime: check Curl_rand_hex's return code


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 33/153: mime: check Curl_rand_hex's return code
Date: Tue, 11 Sep 2018 12:51:44 +0200

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

ng0 pushed a commit to branch master
in repository gnurl.

commit d3905419444614463506243930be1648fb2d7aa7
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Jul 26 16:55:59 2018 +0300

    mime: check Curl_rand_hex's return code
    
    Bug: https://curl.haxx.se/mail/archive-2018-07/0015.html
    Reported-by: Jeffrey Walton
    Closes #2795
---
 lib/mime.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/mime.c b/lib/mime.c
index fd7beb9a4..ca492d11a 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -1228,8 +1228,13 @@ curl_mime *curl_mime_init(struct Curl_easy *easy)
     }
 
     memset(mime->boundary, '-', 24);
-    Curl_rand_hex(easy, (unsigned char *) mime->boundary + 24,
-                  MIME_RAND_BOUNDARY_CHARS + 1);
+    if(Curl_rand_hex(easy, (unsigned char *) mime->boundary + 24,
+                     MIME_RAND_BOUNDARY_CHARS + 1)) {
+      /* failed to get random separator, bail out */
+      free(mime->boundary);
+      free(mime);
+      return NULL;
+    }
     mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL);
   }
 

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



reply via email to

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