svn commit: r298507 - head/usr.sbin/bsnmpd/tools/libbsnmptools
Garrett Cooper
ngie at FreeBSD.org
Sat Apr 23 08:10:06 UTC 2016
Author: ngie
Date: Sat Apr 23 08:10:04 2016
New Revision: 298507
URL: https://svnweb.freebsd.org/changeset/base/298507
Log:
Fix looking for "UTC" at start of ptr by using strnmp instead of improperly
unrolled equivalent
CID: 1347118
MFC after: 1 week
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
Modified:
head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
==============================================================================
--- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat Apr 23 07:36:13 2016 (r298506)
+++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Sat Apr 23 08:10:04 2016 (r298507)
@@ -440,8 +440,8 @@ snmp_date2asn_oid(char *str, struct asn_
/* 'UTC' - optional */
ptr = endptr + 1;
- if (*ptr == 'U' && *(ptr + 1) == 'T' && *(ptr + 1) == 'C')
- ptr += 3;
+ if (strncmp(ptr, "UTC", strlen("UTC")) == 0)
+ ptr += strlen("UTC");
/* '+/-' */
if (*ptr == '-' || *ptr == '+') {
More information about the svn-src-head
mailing list