Acked-by: Ethan Jackson <<a href="mailto:ethan@nicira.com">ethan@nicira.com</a>><br><br><br><div class="gmail_quote">On Wed, Dec 26, 2012 at 12:38 PM, Ben Pfaff <span dir="ltr"><<a href="mailto:blp@nicira.com" target="_blank">blp@nicira.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Also, use ovs_strlcpy() instead of strcpy() just to be a teensy bit safer.<br>
<br>
Found by valgrind.<br>
<br>
Bug #14357.<br>
Signed-off-by: Ben Pfaff <<a href="mailto:blp@nicira.com">blp@nicira.com</a>><br>
---<br>
lib/ofp-util.c | 8 ++++----<br>
1 files changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/lib/ofp-util.c b/lib/ofp-util.c<br>
index e79cc72..2800866 100644<br>
--- a/lib/ofp-util.c<br>
+++ b/lib/ofp-util.c<br>
@@ -3382,9 +3382,9 @@ ofputil_put_ofp10_table_stats(const struct ofp12_table_stats *in,<br>
struct ofp10_table_stats *out;<br>
const struct wc_map *p;<br>
<br>
- out = ofpbuf_put_uninit(buf, sizeof *out);<br>
+ out = ofpbuf_put_zeros(buf, sizeof *out);<br>
out->table_id = in->table_id;<br>
- strcpy(out->name, in->name);<br>
+ ovs_strlcpy(out->name, in->name, sizeof out->name);<br>
out->wildcards = 0;<br>
for (p = wc_map; p < &wc_map[ARRAY_SIZE(wc_map)]; p++) {<br>
if (in->wildcards & htonll(1ULL << p->mf12)) {<br>
@@ -3442,9 +3442,9 @@ ofputil_put_ofp11_table_stats(const struct ofp12_table_stats *in,<br>
{<br>
struct ofp11_table_stats *out;<br>
<br>
- out = ofpbuf_put_uninit(buf, sizeof *out);<br>
+ out = ofpbuf_put_zeros(buf, sizeof *out);<br>
out->table_id = in->table_id;<br>
- strcpy(out->name, in->name);<br>
+ ovs_strlcpy(out->name, in->name, sizeof out->name);<br>
out->wildcards = oxm12_to_ofp11_flow_match_fields(in->wildcards);<br>
out->match = oxm12_to_ofp11_flow_match_fields(in->match);<br>
out->instructions = in->instructions;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.2.5<br>
<br>
_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@openvswitch.org">dev@openvswitch.org</a><br>
<a href="http://openvswitch.org/mailman/listinfo/dev" target="_blank">http://openvswitch.org/mailman/listinfo/dev</a><br>
</font></span></blockquote></div><br>