gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnurl] 136/254: lib510: don't write past the end of the bu


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 136/254: lib510: don't write past the end of the buffer if it's too small
Date: Sat, 17 Jun 2017 16:52:48 +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 b1fa80b84facb94a667a6bfaa99476a161285b0d
Author: Dan Fandrich <address@hidden>
AuthorDate: Sat May 13 22:57:49 2017 +0200

    lib510: don't write past the end of the buffer if it's too small
---
 tests/libtest/lib510.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c
index 68588cfe6..4c290f1ef 100644
--- a/tests/libtest/lib510.c
+++ b/tests/libtest/lib510.c
@@ -48,6 +48,10 @@ static size_t read_callback(void *ptr, size_t size, size_t 
nmemb, void *userp)
 
   if(data) {
     size_t len = strlen(data);
+    if(size*nmemb < len) {
+      fprintf(stderr, "read buffer is too small to run test\n");
+      return 0;
+    }
     memcpy(ptr, data, len);
     pooh->counter++; /* advance pointer */
     return len;

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



reply via email to

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