diff options
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index a70acae496e4..795a0f4e920b 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
24 | #include <linux/mutex.h> | 24 | #include <linux/mutex.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/nsproxy.h> | ||
27 | #include <net/ipv6.h> | 26 | #include <net/ipv6.h> |
28 | 27 | ||
29 | #include <linux/sunrpc/clnt.h> | 28 | #include <linux/sunrpc/clnt.h> |
@@ -884,7 +883,10 @@ static void encode_rpcb_string(struct xdr_stream *xdr, const char *string, | |||
884 | u32 len; | 883 | u32 len; |
885 | 884 | ||
886 | len = strlen(string); | 885 | len = strlen(string); |
887 | BUG_ON(len > maxstrlen); | 886 | WARN_ON_ONCE(len > maxstrlen); |
887 | if (len > maxstrlen) | ||
888 | /* truncate and hope for the best */ | ||
889 | len = maxstrlen; | ||
888 | p = xdr_reserve_space(xdr, 4 + len); | 890 | p = xdr_reserve_space(xdr, 4 + len); |
889 | xdr_encode_opaque(p, string, len); | 891 | xdr_encode_opaque(p, string, len); |
890 | } | 892 | } |