summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-23 20:33:54 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-23 20:33:54 +0000
commit696c7534eca66f0dd64de6aba2ab26e8a4b66eea (patch)
treee8dd0daf6f90cd383e91a24eb0e7c245bf25cab5 /network
parent2e39ac58720cba4fc6e889ec5f18a8ce1d67276c (diff)
network: Added hexadecimal verification for Manager.CreateServer
Diffstat (limited to 'network')
-rw-r--r--network/common.c8
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)