/* \summary: Network File System (NFS) printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
if (length < 2 * sizeof(*dp))
goto trunc;
len = GET_BE_U_4(dp + 1);
+ if (len > length) {
+ ND_PRINT(" [credentials length %u > %u]", len, length);
+ nd_print_invalid(ndo);
+ return NULL;
+ }
rounded_len = roundup2(len, 4);
ND_TCHECK_LEN(dp + 2, rounded_len);
if (2 * sizeof(*dp) + rounded_len <= length) {
if (length < 2 * sizeof(*dp))
goto trunc;
len = GET_BE_U_4(dp + 1);
+ if (len > length) {
+ ND_PRINT(" [verifier length %u > %u]", len, length);
+ nd_print_invalid(ndo);
+ return NULL;
+ }
rounded_len = roundup2(len, 4);
ND_TCHECK_LEN(dp + 2, rounded_len);
if (2 * sizeof(*dp) + rounded_len < length) {
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);
}
- if(fsid.Fsid_dev.Minor == 257)
+ if(fsid.Fsid_dev.Minor == UINT_MAX && fsid.Fsid_dev.Major == UINT_MAX)
/* 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);
}