Browse code

fixed memory issue in fixed length string alternates

Kevin Lin authored on 2015/05/21 03:57:55
Showing 1 changed files
... ...
@@ -2173,7 +2173,7 @@ inline static int ac_special_altstr(const char *hexpr, uint8_t sigopts, struct c
2173 2173
         } else {
2174 2174
             cli_altnmsg("ac_special_altstr: discovered AC_SPECIAL_ALT_STR_FIXED\n");
2175 2175
             special->type = AC_SPECIAL_ALT_STR_FIXED;
2176
-            (special->alt).f_str = (unsigned char **) mpool_malloc(root->mempool, num);
2176
+            (special->alt).f_str = (unsigned char **) mpool_malloc(root->mempool, num * sizeof(unsigned char *));
2177 2177
             if (!((special->alt).f_str)) {
2178 2178
                 cli_errmsg("cli_ac_special_altstr: Can't allocate newspecial->str\n");
2179 2179
                 free(hexprcpy);