]> The Tcpdump Group git mirrors - tcpdump/commitdiff
NFS: Avoid printing non-ASCII characters
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 1 Nov 2023 15:52:21 +0000 (16:52 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 1 Nov 2023 15:56:11 +0000 (16:56 +0100)
The "%s" format is a risk (no non-ASCII filtering), thus use
the fn_print_str() function.

(cherry picked from commit b5353b62c2c58d3ac7c8c84b2df041f5c1602b6b)

print-nfs.c

index 4378121a0fc3319c833433b9c6e0bccc5e79ff38..d08f5c9f993f86c098c8b1734d606d216ba744a2 100644 (file)
@@ -904,7 +904,7 @@ nfs_printfh(netdissect_options *ndo,
 
        if(fsid.Fsid_dev.Minor == 257)
                /* Print the undecoded handle */
-               ND_PRINT("%s", fsid.Opaque_Handle);
+               fn_print_str(ndo, (const u_char *)fsid.Opaque_Handle);
        else
                ND_PRINT("%u", ino);
 }