opkg: add some extra error checks to opkg_verify_file()
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 05:14:14 +0000 (05:14 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 05:14:14 +0000 (05:14 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@96 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_download.c

index 428cad5..6acdc32 100644 (file)
@@ -252,8 +252,12 @@ opkg_verify_file (opkg_conf_t *conf, char *text_file, char *sig_file)
        return -1;
 
     err = gpgme_op_verify (ctx, sig, text, NULL);
+    if (err)
+       return -1;
 
     result = gpgme_op_verify_result (ctx);
+    if (!result)
+       return -1;
 
     /* see if any of the signitures matched */
     s = result->signatures;