changeset 93:0798b9e35725

Check parameters in verify list
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 21 Mar 2014 09:48:46 +0000 (2014-03-21)
parents 4980b0deb773
children f1ebab8639dc
files common/listutil.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/common/listutil.c	Fri Mar 21 09:47:54 2014 +0000
+++ b/common/listutil.c	Fri Mar 21 09:48:46 2014 +0000
@@ -108,6 +108,10 @@
     /* Hash algroithm is sha256 */
     unsigned char hash[32];
 
+    if (!data || !size) {
+        return -1;
+    }
+
     /* Fetch the signature from the first line od data */
     p = strchr(data, '\r');
     if (p == 0 || (unsigned int)(p - (data + 2)) != sig_b64_size) {

http://wald.intevation.org/projects/trustbridge/