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/function.c

    r2768 r2770  
    13601360      var->value[len] = '\0';
    13611361      var->value_length = len;
     1362      VARIABLE_CHANGED (var);
    13621363
    13631364      variable_expand_string_2 (o, body, body_len, &o);
     
    17541755  while ((p = find_next_token (&t, &len)) != 0)
    17551756    {
    1756       ++t;
     1757      if (*t != '\0') /* bird: Fixes access beyond end of string and overflowing words array. */
     1758        ++t;
    17571759      p[len] = '\0';
    17581760      words[wordi++] = p;
     
    21602162              v->value_length = dst - v->value;
    21612163            }
     2164
     2165          VARIABLE_CHANGED (v);
    21622166
    21632167# ifdef CONFIG_WITH_COMPILER
     
    46484652              stack_var->value_length = lastitem - stack_var->value;
    46494653#endif
     4654              VARIABLE_CHANGED (stack_var);
    46504655            }
    46514656        }
Note: See TracChangeset for help on using the changeset viewer.