gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnurl] 120/254: formboundary: convert assert into run-time


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 120/254: formboundary: convert assert into run-time check
Date: Sat, 17 Jun 2017 16:52:32 +0200

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

ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.

commit 158d7016419429e7741ec35d0d6e256985762347
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue May 9 09:08:25 2017 +0200

    formboundary: convert assert into run-time check
    
    ... to really make sure the boundary fits in the target buffer.
    
    Fixes unused parameter 'buflen' warning.
    
    Reported-by: Michael Kaufmann
    Bug: https://github.com/curl/curl/pull/1468#issuecomment-300078754
---
 lib/formdata.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/formdata.c b/lib/formdata.c
index 4c3cf203c..f8a93d594 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -1557,7 +1557,8 @@ static CURLcode formboundary(struct Curl_easy *data,
 {
   /* 24 dashes and 16 hexadecimal digits makes 64 bit (18446744073709551615)
      combinations */
-  DEBUGASSERT(buflen >= 41);
+  if(buflen < 41)
+    return CURLE_BAD_FUNCTION_ARGUMENT;
 
   memset(buffer, '-', 24);
   Curl_rand_hex(data, (unsigned char *)&buffer[24], 17);

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



reply via email to

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