summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-11-12 13:20:52 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-11-12 15:30:50 +0100
commit6cc0c78b1f496cc9e680c0726b7561c93c3f1a7c (patch)
tree87c49dbf1c73d17d811eb7920111a83b79461647 /utils
parent324c9cdbcd3644a0f8eb467b1ea61b9ff889ae7a (diff)
utils/rpctrace: fix crash while printing messages
% 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.
Diffstat (limited to 'utils')
-rw-r--r--utils/rpctrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index b11fea40..c954e515 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 == ' ')
{