← Commit list

079487b48

Denys Vlasenko
Denys Vlasenko
2020-10-20
SUCCESS Duration: 150s

Subject

hexdump: fix dup block comparison

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/dump.c+0 -1
@@ -432,7 +432,6 @@ static unsigned char *get(priv_dumper_t *dumper)
if (dumper->pub.dump_vflag != DUP) {
puts("*");
}
- return NULL;
}
memset(dumper->get__curp + nread, 0, need);
dumper->eaddress = dumper->address + nread;
testsuite/hexdump.tests+19 -0
@@ -15,4 +15,23 @@ testing 'hexdump -C with four NULs' \
'' \
'\0\0\0\0'
+testing "hexdump does not think last padded block matches any full block" \
+ "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
+ "\
+00|00!
+*
+00| !
+" \
+ '' \
+ '\0\0\0\0\0\0\0\0\0\0\0'
+
+testing "hexdump thinks last full block can match" \
+ "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
+ "\
+00|00!
+*
+" \
+ '' \
+ '\0\0\0\0\0\0\0\0\0\0\0\0'
+
exit $FAILCOUNT