monitor: Fix compiler warning from wrong array size 97/204997/1
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 23 May 2018 14:34:52 +0000 (16:34 +0200)
committerAmit Purwar <amit.purwar@samsung.com>
Mon, 29 Apr 2019 04:08:46 +0000 (09:38 +0530)
Change-Id: I733c6045f104f04a4e691440a745bc1b1efcec4b
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
monitor/control.c
monitor/packet.c

index 7c8de2c..d77498b 100755 (executable)
@@ -1152,7 +1152,7 @@ void control_server(const char *path)
 
        memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
-       strncpy(addr.sun_path, path, len);
+       strncpy(addr.sun_path, path, len - 1);
 
        if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
                perror("Failed to bind server socket");
index 63d3cb2..bd9f814 100755 (executable)
@@ -10061,7 +10061,7 @@ void packet_user_logging(struct timeval *tv, struct ucred *cred,
                                        uint16_t index, uint8_t priority,
                                        const char *ident, const char *message)
 {
-       char pid_str[128];
+       char pid_str[140];
        const char *label;
        const char *color;