diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2019-02-26 09:17:37 +0100 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2019-02-26 09:21:27 +0100 |
commit | 597cb1874068054d4c0be41f161a72ef37888930 (patch) | |
tree | 8899c19634bd8e393a8eac05f33925e4d75bd77d /lib/librte_pci/rte_pci.c | |
parent | 6e7cbd63706f3435b9d9a2057a37db1da01db9a7 (diff) |
New upstream version 17.11.5upstream-17.11-stable
Change-Id: I8d2aa1aee2a9a78614dff5a01008f91e88e810c7
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_pci/rte_pci.c')
-rw-r--r-- | lib/librte_pci/rte_pci.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |