bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH hurd] utils/rpctrace: fix crash while printing messages


From: Justus Winter
Subject: [PATCH hurd] utils/rpctrace: fix crash while printing messages
Date: Wed, 12 Nov 2014 13:31:04 +0100

% fakeroot rpctrace install
[...]
  63<--66(pid5363)->io_read (-1 8192) = 0 [... rpctrace crashes]
/bin/fakeauth: Segmentation fault for child 5362
/bin/settrans: Error 139 for child 5361

* utils/rpctrace.c (print_data): Fix this by guarding the code
escaping non-printable characters introduced in 84932431 against
`data' being NULL.
---
 utils/rpctrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index b11fea4..c954e51 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -1606,7 +1606,7 @@ print_data (mach_msg_type_name_t type,
         the first character that has not yet been printed.  */
       const char *p, *q;
       p = q = (const char *) data;
-      while (*q && q - (const char *) data < (int) (nelt * eltsize))
+      while (q && *q && q - (const char *) data < (int) (nelt * eltsize))
        {
          if (isgraph (*q) || *q == ' ')
            {
-- 
2.1.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]