X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=lib%2Flibrte_pci%2Frte_pci.c;h=f400178bb63420a56292ea1ce6f53999222c2710;hb=refs%2Ftags%2Fupstream%2F18.11-rc3;hp=530738dbdf4757bd487a37bd1995345f593ad8c4;hpb=88fab00d4402af240c1b7cc2566133aece115488;p=deb_dpdk.git diff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c index 530738db..f400178b 100644 --- a/lib/librte_pci/rte_pci.c +++ b/lib/librte_pci/rte_pci.c @@ -30,6 +30,10 @@ get_u8_pciaddr_field(const char *in, void *_u8, char dlm) uint8_t *u8 = _u8; char *end; + /* empty string is an error though strtoul() returns 0 */ + if (*in == '\0') + return NULL; + errno = 0; val = strtoul(in, &end, 16); if (errno != 0 || end[0] != dlm || val > UINT8_MAX) {