p += sizeof (guint64); \
} while (0)
#define SZ_SKIP_BYTES(n) do { \
- if (end - p > (n)) { \
+ if (end - p >= (n)) { \
p += (n); \
} \
else { \
case kATime:
case kMTime:
/* We don't care of these guys, but we still have to parse them, gah */
- if (sz == 0) {
- goto end;
- }
- else {
+ if (sz > 0) {
SZ_SKIP_BYTES (sz);
}
break;
res = rspamd_7zip_ucs2_to_utf8 (task, p, fend);
if (res != NULL) {
- fentry = g_malloc0 (sizeof (fentry));
+ fentry = g_malloc0 (sizeof (*fentry));
fentry->fname = res;
g_ptr_array_add (arch->files, fentry);
+ msg_debug_archive ("7zip: found file %v", res);
}
else {
msg_debug_archive ("bad 7zip name; %s", G_STRLOC);
break;
case kDummy:
case kWinAttributes:
- if (sz == 0) {
- goto end;
- }
- else {
+ if (sz > 0) {
SZ_SKIP_BYTES (sz);
}
break;