X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hsrv.c;h=3f11047e92db04443a59ffd665e91d776dfe3360;hb=60cd11786766ebc148b7ec088962dd6e112f8762;hp=0d0bd0619acd9d01631877eaada26f85818c2a73;hpb=77bf8a30c07a4ab5690337ed362dae4414e590fb;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c index 0d0bd061..3f11047e 100644 --- a/src/afb-hsrv.c +++ b/src/afb-hsrv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017, 2018 "IoT.bzh" + * Copyright (C) 2016-2019 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,11 +42,11 @@ #include "afb-hsrv.h" #include "afb-fdev.h" #include "afb-socket.h" + #include "fdev.h" #include "verbose.h" #include "locale-root.h" - -#include "afb-systemd.h" +#include "systemd.h" #include "jobs.h" #define JSON_CONTENT "application/json" @@ -56,7 +56,7 @@ struct hsrv_itf { struct hsrv_itf *next; struct afb_hsrv *hsrv; struct fdev *fdev; - char uri[1]; + char uri[]; }; struct hsrv_handler { @@ -562,7 +562,7 @@ int afb_hsrv_add_interface(struct afb_hsrv *hsrv, const char *uri) { struct hsrv_itf *itf; - itf = malloc(sizeof *itf + strlen(uri)); + itf = malloc(sizeof *itf + 1 + strlen(uri)); if (itf == NULL) return -1;