]> git.proxmox.com Git - mirror_corosync.git/commitdiff
totemconfig: Check length of rrp_mode string
authorJan Friesse <jfriesse@redhat.com>
Mon, 17 Jun 2013 14:11:29 +0000 (16:11 +0200)
committerJan Friesse <jfriesse@redhat.com>
Tue, 18 Jun 2013 12:35:15 +0000 (14:35 +0200)
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
exec/totemconfig.c

index a547aba2e446805d3c0aad316974d6e5494d2133..65a061b0b724e96ac6645c31e7f978adfadbeffb 100644 (file)
@@ -467,6 +467,12 @@ extern int totem_config_read (
        }
 
        if (icmap_get_string("totem.rrp_mode", &str) == CS_OK) {
+               if (strlen(str) >= TOTEM_RRP_MODE_BYTES) {
+                       *error_string = "totem.rrp_mode is too long";
+                       free(str);
+
+                       return -1;
+               }
                strcpy (totem_config->rrp_mode, str);
                free(str);
        }