diff options
Diffstat (limited to 'network/common.c')
-rw-r--r-- | network/common.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/network/common.c b/network/common.c index 1be7bbe4..7fbfee91 100644 --- a/network/common.c +++ b/network/common.c @@ -69,6 +69,7 @@ static struct { uint16_t bnep_service_id(const char *svc) { int i; + uint16_t id; /* Friendly service name */ for (i = 0; __svc[i].name; i++) @@ -82,9 +83,12 @@ uint16_t bnep_service_id(const char *svc) return __svc[i].id; } - /* FIXME: Missing HEX string verification */ + /* Try convert to HEX */ + id = strtol(svc, NULL, 16); + if ((id < BNEP_SVC_PANU) || (id > BNEP_SVC_GN)) + return 0; - return 0; + return id; } const char *bnep_uuid(uint16_t id) |