commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 04/05: rpctrace: Print beyond '\0' in MACH_MSG_TYPE_CHAR.


From: Samuel Thibault
Subject: [hurd] 04/05: rpctrace: Print beyond '\0' in MACH_MSG_TYPE_CHAR.
Date: Fri, 26 Aug 2016 07:55:12 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit ca5b01f538c122dc1f0e989f5703c75b8cf8ca3a
Author: Kalle Olavi Niemitalo <address@hidden>
Date:   Wed Aug 24 00:41:30 2016 +0300

    rpctrace: Print beyond '\0' in MACH_MSG_TYPE_CHAR.
    
    This will now display the 'argv: data_t' argument of file_exec
    as e.g. "who\0am\0i\0" rather than just "who".  In contrast,
    the 'file_name: string_t' argument of dir_lookup will still be
    truncated at the first null character.
    
    The previous implementation might crash if an out-of-line
    char array exactly fills a page and does not contain any
    null characters.
    
    * utils/rpctrace.c (print_data): On MACH_MSG_TYPE_STRING and
    MACH_MSG_TYPE_CHAR, check for end of buffer before checking for a null
    character.  On MACH_MSG_TYPE_CHAR only, continue printing past null
    characters.
---
 utils/rpctrace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index 276377c..25d9bc6 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -1524,7 +1524,8 @@ 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 && q - (const char *) data < (int) (nelt * eltsize))
+      while (q && q - (const char *) data < (int) (nelt * eltsize)
+            && (*q || type == MACH_MSG_TYPE_CHAR))
        {
          if (isgraph (*q) || *q == ' ')
            {

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

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