projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
tcp: warn if offset reach the maxlen limit when using snprintf
[linux-2.6-microblaze.git]
/
net
/
ipv4
/
tcp_ulp.c
diff --git
a/net/ipv4/tcp_ulp.c
b/net/ipv4/tcp_ulp.c
index
4849edb
..
12ab5db
100644
(file)
--- a/
net/ipv4/tcp_ulp.c
+++ b/
net/ipv4/tcp_ulp.c
@@
-92,6
+92,9
@@
void tcp_get_available_ulp(char *buf, size_t maxlen)
offs += snprintf(buf + offs, maxlen - offs,
"%s%s",
offs == 0 ? "" : " ", ulp_ops->name);
+
+ if (WARN_ON_ONCE(offs >= maxlen))
+ break;
}
rcu_read_unlock();
}