]> granicus.if.org Git - strace/commitdiff
s390: fix PRINT_UNKNOWN_TAIL_EX
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 4 Sep 2019 08:50:59 +0000 (10:50 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 4 Sep 2019 10:57:03 +0000 (12:57 +0200)
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 <dan@danny.cz>
Resolves: https://github.com/strace/strace/issues/108

s390.c

diff --git a/s390.c b/s390.c
index d11644ddd814d99d28042ab8ae3b4cbe3a4f7b63..54f6c355ced972215b17195d9574cd71dad525d1 100644 (file)
--- 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)