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 428cad5ff82c54caab4c9a808dfe9f5f4c4c054a..6acdc326f2e6a12c217a37e19e7683e54884a2f7 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);
        return -1;
 
     err = gpgme_op_verify (ctx, sig, text, NULL);
+    if (err)
+       return -1;
 
     result = gpgme_op_verify_result (ctx);
 
     result = gpgme_op_verify_result (ctx);
+    if (!result)
+       return -1;
 
     /* see if any of the signitures matched */
     s = result->signatures;
 
     /* see if any of the signitures matched */
     s = result->signatures;