HomeFreeBSD

Fix theoretical buffer overflow issues in snmp_oid2asn_oid

Description

Fix theoretical buffer overflow issues in snmp_oid2asn_oid

Increase the size of string by 1 to account for the '\0' terminator. In the event
that str doesn't contain any non-alpha chars, i would be set to MAXSTR, and
the subsequent strlcpy call would overflow by a character.

Remove unnecessary string[i] = '\0' -- this is already handled by strlcpy.

MFC after: 1 week
Reported by: clang
Sponsored by: EMC / Isilon Storage Division

Details

Provenance
ngieAuthored on
Parents
rS299764: Use the size of the destination buffer, not the source buffer.
Branches
Unknown
Tags
Unknown