summaryrefslogtreecommitdiff
path: root/lib/librte_cmdline/cmdline_parse_etheraddr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librte_cmdline/cmdline_parse_etheraddr.c')
-rw-r--r--lib/librte_cmdline/cmdline_parse_etheraddr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/librte_cmdline/cmdline_parse_etheraddr.c b/lib/librte_cmdline/cmdline_parse_etheraddr.c
index 5285c40..64ae86c 100644
--- a/lib/librte_cmdline/cmdline_parse_etheraddr.c
+++ b/lib/librte_cmdline/cmdline_parse_etheraddr.c
@@ -137,12 +137,15 @@ my_ether_aton(const char *a)
int
cmdline_parse_etheraddr(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
- const char *buf, void *res)
+ const char *buf, void *res, unsigned ressize)
{
unsigned int token_len = 0;
char ether_str[ETHER_ADDRSTRLENLONG+1];
struct ether_addr *tmp;
+ if (res && ressize < sizeof(struct ether_addr))
+ return -1;
+
if (!buf || ! *buf)
return -1;