Fix a heap corruption in envtable creation routine
authorChristian Grothoff <christian@grothoff.org>
Tue, 19 Jul 2011 11:12:08 +0000 (11:12 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 19 Jul 2011 11:12:08 +0000 (11:12 +0000)
-LRN

src/util/os_priority.c

index 0a08cf9cee91764d0a101b5218507d42af0de086..fc11a7abf0d39717437fca434f8b83e0a6e2de3a 100644 (file)
@@ -428,7 +428,7 @@ CreateCustomEnvTable (char **vars)
     return NULL;
   for (c = 0, var_ptr = vars; *var_ptr; var_ptr += 2, c++);
   n_var = c;
-  index = GNUNET_malloc (n_var);
+  index = GNUNET_malloc (sizeof (char *) * n_var);
   for (c = 0; c < n_var; c++)
     index[c] = 0;
   for (items_count = 0, ptr = win32_env_table; ptr[0] != 0; items_count++)