1
1
Nathan Hjelm 32236736a4 Fix parsing of envvars in MCA files
This commit fixes a memory corruption bug when parsing lines of the
form:

-x FOO=bar

The code was making changes to the size of the buffer allocated for
key_buffer without making the appropriate changes to
key_buffer_len. This was causing subsequent calls to save_param_name
to write to invalid memory.

This commit makes the following changes:

  - Fix the above bug by modifying trim_name to move the string within
    the buffer instead of re-allocating space for the trimmed string.

  - Cleaned up both trim_name and save_param_name. Both functions took
    a prefix and suffix to trim. Problem was the prefix was not
    treated like a prefix. Instead the "prefix" was located inside the
    string using strstr then the trimmed value started after the
    substring (even in the middle of the string). To allow trimming
    both -x and --x (as well as -mca and --mca) trim_name is now
    called with each prefix.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
2016-02-17 14:58:05 -07:00
..
2015-08-18 09:11:38 -06:00
2015-06-23 20:59:57 -07:00
2015-08-29 16:04:10 -07:00
2016-02-16 16:49:04 -07:00
2016-02-17 14:58:05 -07:00
2015-06-25 10:14:13 -06:00
2015-06-23 20:59:57 -07:00