Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
plugin: improves error detection
[src/app-framework-binder.git]
/
src
/
afb-api-dbus.c
diff --git
a/src/afb-api-dbus.c
b/src/afb-api-dbus.c
index
5b75bfa
..
edbb1ed
100644
(file)
--- a/
src/afb-api-dbus.c
+++ b/
src/afb-api-dbus.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2015 "IoT.bzh"
+ * Copyright (C) 2015
, 2016
"IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-25,8
+25,8
@@
#include <systemd/sd-bus.h>
#include <json-c/json.h>
#include <systemd/sd-bus.h>
#include <json-c/json.h>
-#include
"afb-plugin.h"
-#include
"afb-req-itf.h"
+#include
<afb/afb-plugin.h>
+#include
<afb/afb-req-itf.h>
#include "afb-common.h"
#include "afb-common.h"
@@
-91,6
+91,10
@@
static struct api_dbus *make_api_dbus_3(int system, const char *path, size_t pat
goto error2;
}
api->api++;
goto error2;
}
api->api++;
+ if (!afb_apis_is_valid_api_name(api->api)) {
+ errno = EINVAL;
+ goto error2;
+ }
/* the name/interface is copied after the path */
api->name = &api->path[pathlen + 1];
/* the name/interface is copied after the path */
api->name = &api->path[pathlen + 1];