]> The Tcpdump Group git mirrors - tcpdump/commitdiff
NFS: Avoid printing non-ASCII characters
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 2 Nov 2023 09:20:00 +0000 (10:20 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 2 Nov 2023 09:20:00 +0000 (10:20 +0100)
The "%s" format is a risk (no non-ASCII filtering), thus use
the fn_print_str() function.

print-nfs.c

index d08f5c9f993f86c098c8b1734d606d216ba744a2..8d403a20c9b639bc65e5bbf8e73ad97d762360c8 100644 (file)
@@ -896,7 +896,9 @@ nfs_printfh(netdissect_options *ndo,
                if (spacep)
                        *spacep = '\0';
 
                if (spacep)
                        *spacep = '\0';
 
-               ND_PRINT(" fh %s/", temp);
+               ND_PRINT(" fh ");
+               fn_print_str(ndo, (const u_char *)temp);
+               ND_PRINT("/");
        } else {
                ND_PRINT(" fh %u,%u/",
                             fsid.Fsid_dev.Major, fsid.Fsid_dev.Minor);
        } else {
                ND_PRINT(" fh %u,%u/",
                             fsid.Fsid_dev.Major, fsid.Fsid_dev.Minor);