From 8a853e3f0275efc8b05cb195085d45946942744a Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 14 Nov 2018 11:13:11 +0000 Subject: New upstream version 18.11-rc3 Change-Id: I958b9d019027ef049bd992b3968a667f3ae382ae Signed-off-by: Luca Boccassi --- lib/librte_pci/rte_pci.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/librte_pci/rte_pci.c') 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) { -- cgit 1.2.3-korg