[gnome-builder] editorconfig: add precondition check for name length
- From: Christian Hergert <chergert src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-builder] editorconfig: add precondition check for name length
 
- Date: Sat,  3 Oct 2015 23:58:50 +0000 (UTC)
 
commit 47ab24a8156a90c6c7c61273126aa4301758fcfc
Author: Christian Hergert <christian hergert me>
Date:   Sat Oct 3 16:58:38 2015 -0700
    editorconfig: add precondition check for name length
    
    If only everyone used glib.
 contrib/libeditorconfig/editorconfig.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/contrib/libeditorconfig/editorconfig.c b/contrib/libeditorconfig/editorconfig.c
index 778b23c..dcf2d39 100644
--- a/contrib/libeditorconfig/editorconfig.c
+++ b/contrib/libeditorconfig/editorconfig.c
@@ -139,6 +139,10 @@ static int array_editorconfig_name_value_add(
     /* always use name_lwr but not name, since property names are case
      * insensitive */
     char        name_lwr[MAX_PROPERTY_NAME];
+
+    if (strlen (name) > (MAX_PROPERTY_NAME - 1))
+      return -1;
+
     /* For the first time we came here, aenv->name_values is NULL */
     if (aenv->name_values == NULL) {
         aenv->name_values = (editorconfig_name_value*)malloc(
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]