ovs_events plugin: Replace strncpy() with sstrncpy().
authorFlorian Forster <octo@collectd.org>
Wed, 15 Nov 2017 21:03:53 +0000 (22:03 +0100)
committerFlorian Forster <octo@collectd.org>
Fri, 17 Nov 2017 12:22:50 +0000 (13:22 +0100)
CID: 179243

src/ovs_events.c

index afa1199..bf457fd 100644 (file)
@@ -253,8 +253,8 @@ static int ovs_events_plugin_config(oconfig_item_t *ci) {
         ovs_events_config_free();
         return -1;
       }
-      strncpy(ovs_events_ctx.config.ovs_db_serv, service,
-              sizeof(ovs_events_ctx.config.ovs_db_serv));
+      sstrncpy(ovs_events_ctx.config.ovs_db_serv, service,
+               sizeof(ovs_events_ctx.config.ovs_db_serv));
       sfree(service);
     } else if (strcasecmp("Socket", child->key) == 0) {
       if (cf_util_get_string_buffer(