Re: [PATCH 3/3] build: avoid strtol and strtod

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/18/2012 08:14 PM, Eric Blake wrote:
Ensure we don't introduce any more lousy integer parsing in new
code, while avoiding a scrub-down of existing legacy code.

Note that we also need to enable sc_prohibit_atoi_atof (see cfg..mk
local-checks-to-sckip) before we are bulletproof, but that also
entails scrubbing I'm not ready to do at the moment.


[...]
diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
index beb6274..6c0fb24 100644
--- a/src/util/virmacaddr.c
+++ b/src/util/virmacaddr.c
@@ -86,7 +86,7 @@ virMacAddrParse(const char* str, unsigned char *addr)
          if (!c_isxdigit(*str))
              break;

-        result = strtoul(str,&end_ptr, 16);
+        result = strtoul(str,&end_ptr, 16); /* exempt from syntax-check */

          if ((end_ptr - str)<  1 || 2<  (end_ptr - str) ||
              (errno != 0) ||

ACK

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]