Code

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 afa11997cfc3a1ec8fadd50a29db39c1d0ecd7b3..bf457fdb68ec378c7f8ad1e11179c000baf9674f 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(