From: Dmitry V. Levin Date: Mon, 16 May 2016 21:35:07 +0000 (+0000) Subject: Fix printing of invalid d_type in getdents syscall X-Git-Tag: v4.12~152 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fb984e27ec57690cf7663160f3c0694693e9f69;p=strace Fix printing of invalid d_type in getdents syscall * dirent.c (SYS_FUNC(getdents)): Treat d_type as unsigned char to avoid potential sign-extension bug when printing invalid d_type. --- diff --git a/dirent.c b/dirent.c index de5a163d..7d882ae2 100644 --- a/dirent.c +++ b/dirent.c @@ -76,7 +76,7 @@ SYS_FUNC(readdir) SYS_FUNC(getdents) { unsigned int i, len, dents = 0; - char *buf; + unsigned char *buf; if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]);