]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Avoid shifting negative numbers by doing endian manipulation unsignedly.
authorJoerg Sonnenberger <joerg@bec.de>
Sat, 29 Apr 2017 16:53:56 +0000 (18:53 +0200)
committerJoerg Sonnenberger <joerg@bec.de>
Sat, 29 Apr 2017 16:53:56 +0000 (18:53 +0200)
libarchive/archive_read_support_format_rar.c

index 1e9849fdd629846e4cfd2027096800b69cedc85f..cbb14c32dc3bbd4874390b53a2f97e3dd5167e2d 100644 (file)
@@ -1750,7 +1750,7 @@ read_exttime(const char *p, struct rar *rar, const char *endp)
         return (-1);
       for (j = 0; j < count; j++)
       {
-        rem = ((*p) << 16) | (rem >> 8);
+        rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
         p++;
       }
       tm = localtime(&t);