fix segmentation fault when plugins are loaded
Function rpc_plugin_register_library() is modifying the struct's contents in list_add() call. That said, the rpc_plugin struct should not be defined as const. This caused segmentation fault when built on up-to-date Arch Linux. Signed-off-by: Luka Perkov <luka@openwrt.org>
This commit is contained in:
parent
835b8b768d
commit
4cc6a9deb8
2 changed files with 2 additions and 2 deletions
2
file.c
2
file.c
|
@ -612,6 +612,6 @@ rpc_file_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx)
|
||||||
return ubus_add_object(ctx, &obj);
|
return ubus_add_object(ctx, &obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct rpc_plugin rpc_plugin = {
|
struct rpc_plugin rpc_plugin = {
|
||||||
.init = rpc_file_api_init
|
.init = rpc_file_api_init
|
||||||
};
|
};
|
||||||
|
|
2
iwinfo.c
2
iwinfo.c
|
@ -652,6 +652,6 @@ rpc_iwinfo_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx)
|
||||||
return ubus_add_object(ctx, &obj);
|
return ubus_add_object(ctx, &obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct rpc_plugin rpc_plugin = {
|
struct rpc_plugin rpc_plugin = {
|
||||||
.init = rpc_iwinfo_api_init
|
.init = rpc_iwinfo_api_init
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue