← Commit list

84a130588

Emanuele Giacomelli
Emanuele Giacomelli
2022-01-08
SUCCESS Duration: 154s

Subject

XXXsum: handle binary sums with " " in the path

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 →

coreutils/md5_sha1_sum.c+4 -6
@@ -300,12 +300,10 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
char *filename_ptr;
count_total++;
- filename_ptr = strstr(line, " ");
- /* handle format for binary checksums */
- if (filename_ptr == NULL) {
- filename_ptr = strstr(line, " *");
- }
- if (filename_ptr == NULL) {
+ filename_ptr = strchr(line, ' ');
+ if (filename_ptr == NULL
+ || (filename_ptr[1] != ' ' && filename_ptr[1] != '*')
+ ) {
if (flags & FLAG_WARN) {
bb_simple_error_msg("invalid format");
}