Skip to content

Commit

Permalink
dccp: return -EINVAL on invalid feature length
Browse files Browse the repository at this point in the history
dccp_feat_change() validates length and on error is returning 1.
This happens to work since call chain is checking for 0 == success,
but this is returned to userspace, so make it a real error value.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Chris Wright authored and David S. Miller committed May 5, 2008
1 parent 7a1aa30 commit 1944317
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/dccp/feat.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int dccp_feat_change(struct dccp_minisock *dmsk, u8 type, u8 feature,

if (len > 3) {
DCCP_WARN("invalid length %d\n", len);
return 1;
return -EINVAL;
}
/* XXX add further sanity checks */

Expand Down

0 comments on commit 1944317

Please sign in to comment.