static void hook_xreq_get_client_info(void *closure, const struct afb_hookid *hookid, const struct afb_xreq *xreq, struct json_object *result)
{
- hook_xreq(closure, hookid, xreq, "get_client_info", "{so}",
+ hook_xreq(closure, hookid, xreq, "get_client_info", "{sO}",
"result", result);
}
{
char path[PATH_MAX], proc[100];
const char *key, *val;
+ ssize_t s;
if (result >= 0) {
snprintf(proc, sizeof proc, "/proc/self/fd/%d", result);
- readlink(proc, path, sizeof path);
+ s = readlink(proc, path, sizeof path);
+ path[s < 0 ? 0 : s >= sizeof path ? sizeof path - 1 : s] = 0;
key = "path";
val = path;
} else {
{
char path[PATH_MAX], proc[100];
const char *key, *val;
+ ssize_t s;
if (result >= 0) {
snprintf(proc, sizeof proc, "/proc/self/fd/%d", result);
- readlink(proc, path, sizeof path);
+ s = readlink(proc, path, sizeof path);
+ path[s < 0 ? 0 : s >= sizeof path ? sizeof path - 1 : s] = 0;
key = "path";
val = path;
} else {
}
/* drop traces */
-extern int afb_trace_drop(afb_req_t req, struct json_object *args, struct afb_trace *trace)
+int afb_trace_drop(afb_req_t req, struct json_object *args, struct afb_trace *trace)
{
int rc;
struct context context;