]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
apk: tweak apk_add_hdrid a bit
authorMichael Schroeder <mls@suse.de>
Thu, 20 Mar 2025 14:11:19 +0000 (15:11 +0100)
committerMichael Schroeder <mls@suse.de>
Thu, 20 Mar 2025 14:11:19 +0000 (15:11 +0100)
Make sure that the checksum starts with 'Q'.

ext/repo_apk.c

index dc1ef1b42e4ac6bf440cff9812968e30a5feed93..ec151591b8fdb42f630c0e3490b437badd6a8c84 100644 (file)
@@ -557,7 +557,9 @@ apk_add_hdrid(Repodata *data, Id p, char *idstr)
   size_t l = strlen(idstr);
   unsigned char chksum[33], *cp = chksum;
 
-  if (((l == 30 || l == 46) && idstr[0] == 'Q' && idstr[1] == '1') || (idstr[1] == '2' && l == 46))
+  if (idstr[0] != 'Q')
+    return;
+  if ((idstr[1] == '1' && (l == 30 || l == 46)) || (idstr[1] == '2' && l == 46))
     {
       int xpos = idstr[1] == '2' ? 43 : 27;
       int i, v;