From: Eugene Syromyatnikov Date: Wed, 4 Sep 2019 08:50:59 +0000 (+0200) Subject: s390: fix PRINT_UNKNOWN_TAIL_EX X-Git-Tag: v5.3~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d969e54109dae38e49fceaf576587007011cfecd;p=strace s390: fix PRINT_UNKNOWN_TAIL_EX In the conversion of PRINT_UNKNOWN_TAIL into PRINT_UNKNOWN_TAIL_EX the usage of sizeof(*(hdr_)) hasn't been replaced to (hdr_size_) in all places. Offset calculation also had to be changed. * s390.c (PRINT_UNKNOWN_TAIL_EX): Fix addr and len arguments in is_filled and print_quoted_string calls. Fixes: v5.2-97-g210593c "s390: update sthyi decoder" Reported-by: Dan HorĂ¡k Resolves: https://github.com/strace/strace/issues/108 --- diff --git a/s390.c b/s390.c index d11644dd..54f6c355 100644 --- a/s390.c +++ b/s390.c @@ -496,11 +496,11 @@ decode_ebcdic(const char *ebcdic, char *ascii, size_t size) # define PRINT_UNKNOWN_TAIL_EX(hdr_, hdr_size_, size_) \ do { \ if ((size_) > (hdr_size_) && \ - !is_filled((char *) ((hdr_) + 1), '\0', \ - (size_) - sizeof(*(hdr_)))) { \ - tprints(", "); \ - print_quoted_string((char *) ((hdr_) + 1), \ - (size_) - sizeof(*(hdr_)), \ + !is_filled(((char *) hdr_) + (hdr_size_), '\0', \ + (size_) - (hdr_size_))) { \ + tprints(", "); \ + print_quoted_string(((char *) hdr_) + (hdr_size_), \ + (size_) - (hdr_size_), \ QUOTE_FORCE_HEX); \ } \ } while (0)