It's extremely unlikely, but:

+       char name[8];

+       sprintf(name, "ib_mad%d", port_num);

if port_num >= 10, this will overflow the buffer.  Since a device
could conceivably have up to 255 ports (although an HCA with hundreds
of ports is rather far-fetched, and we only create one port for a
switch), I would suggest doing

        char name[sizeof "ib_mad123"];

and

        snprintf(name, sizeof name, "ib_mad%d", port_num);

for correctness and (mostly) ease of auditing.

 - Roland
_______________________________________________
openib-general mailing list
[EMAIL PROTECTED]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to