From 0f246bb133faf233b2fbdd1947e7e5b5819d15e7 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 27 Mar 2013 05:54:13 +0000 Subject: [PATCH] --- yaml --- r: 368733 b: refs/heads/master c: 5a048e3b59fb4211b7978f78217878071c344379 h: refs/heads/master i: 368731: cda65cea4e3d8caa81ac07fe339139f31a6c6c05 v: v3 --- [refs] | 2 +- trunk/net/core/utils.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index b094aa919a98..abc625dc2868 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 05fcaeac05c56ebe5a336fe617c0a0db4dc7ae3b +refs/heads/master: 5a048e3b59fb4211b7978f78217878071c344379 diff --git a/trunk/net/core/utils.c b/trunk/net/core/utils.c index e3487e461939..3c7f5b51b979 100644 --- a/trunk/net/core/utils.c +++ b/trunk/net/core/utils.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -348,9 +349,7 @@ int mac_pton(const char *s, u8 *mac) /* Don't dirty result unless string is valid MAC. */ for (i = 0; i < ETH_ALEN; i++) { - if (!strchr("0123456789abcdefABCDEF", s[i * 3])) - return 0; - if (!strchr("0123456789abcdefABCDEF", s[i * 3 + 1])) + if (!isxdigit(s[i * 3]) || !isxdigit(s[i * 3 + 1])) return 0; if (i != ETH_ALEN - 1 && s[i * 3 + 2] != ':') return 0;