mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Audit commit 1177c73: musl libc compat changes
Must initialize init_request buffer to zero before communicating with Finit. Found by Coverity Scan. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -77,17 +77,17 @@ exit:
|
||||
|
||||
static int runlevel_get(void)
|
||||
{
|
||||
struct init_request rq;
|
||||
int sd, result = 255;
|
||||
|
||||
rq.cmd = INIT_CMD_GET_RUNLEVEL;
|
||||
rq.magic = INIT_MAGIC;
|
||||
|
||||
struct init_request rq;
|
||||
struct sockaddr_un sun = {
|
||||
.sun_family = AF_UNIX,
|
||||
.sun_path = INIT_SOCKET,
|
||||
};
|
||||
|
||||
memset(&rq, 0, sizeof(rq));
|
||||
rq.cmd = INIT_CMD_GET_RUNLEVEL;
|
||||
rq.magic = INIT_MAGIC;
|
||||
|
||||
sd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (-1 == sd)
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user