Changeset 2770 for trunk/src/kmk/read.c


Ignore:
Timestamp:
Feb 1, 2015, 6:12:37 PM (10 years ago)
Author:
bird
Message:

string expansion debugged and enabled. fixed access-after-alloc bug in func_sort and could lead to heap corruption.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/read.c

    r2717 r2770  
    22962296
    22972297          v->origin = origin;
     2298#ifndef CONFIG_WITH_VALUE_LENGTH
    22982299          if (v->flavor == f_simple)
    22992300            v->value = allocated_variable_expand (v->value);
    23002301          else
    23012302            v->value = xstrdup (v->value);
     2303#else
     2304          v->value_length = strlen (v->value);
     2305          if (v->flavor == f_simple)
     2306            v->value = allocated_variable_expand_2 (v->value, v->value_length, &v->value_length);
     2307          else
     2308            v->value = (char *)memcpy (xmalloc (v->value_length + 1), v->value, v->value_length + 1);
     2309          v->value_alloc_len = v->value_length + 1;
     2310#endif
    23022311
    23032312          fname = p->target;
     
    23702379              v->recursive = gv->recursive;
    23712380              v->append = 0;
     2381              VARIABLE_CHANGED (v);
    23722382            }
    23732383        }
Note: See TracChangeset for help on using the changeset viewer.