X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=lib%2Flibrte_pci%2Frte_pci.c;h=ac0b1a6f0b075cf1b316ddfe0c805abb529c1291;hb=refs%2Fheads%2Fupstream-17.11-stable;hp=0160fc1eb8aa9eb829cd1d7e504a90d069727e29;hpb=6e7cbd63706f3435b9d9a2057a37db1da01db9a7;p=deb_dpdk.git diff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c index 0160fc1e..ac0b1a6f 100644 --- a/lib/librte_pci/rte_pci.c +++ b/lib/librte_pci/rte_pci.c @@ -59,6 +59,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) {