Merge pull request #3277 from abays/sysevent
authorMatthias Runge <mrunge@redhat.com>
Tue, 17 Sep 2019 12:00:47 +0000 (14:00 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Sep 2019 12:00:47 +0000 (14:00 +0200)
Use sstrncpy instead of strncpy in sysevent plugin

src/sysevent.c

index b63767d..aab5141 100644 (file)
@@ -472,7 +472,7 @@ static int read_socket() {
     } else {
       DEBUG("sysevent plugin: writing %s", buffer);
 
-      strncpy(ring.buffer[ring.head], buffer, sizeof(buffer));
+      sstrncpy(ring.buffer[ring.head], buffer, sizeof(buffer));
       ring.timestamp[ring.head] = cdtime();
       ring.head = next;
     }