diff options
author | Nico Huber <nico.h@gmx.de> | 2022-08-26 11:36:48 +0200 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2022-09-18 20:47:34 +0000 |
commit | ca61c3dd3efcdf1aa5c7ea055514b0985e5fff48 (patch) | |
tree | 48d118ef1a00f447e91b47e6fff464e34ccae833 /ogp_spi.c | |
parent | 869f3f7b2cf0864e193a198f0423919fedde7765 (diff) | |
download | flashrom-ca61c3dd3efcdf1aa5c7ea055514b0985e5fff48.tar.gz flashrom-ca61c3dd3efcdf1aa5c7ea055514b0985e5fff48.tar.bz2 flashrom-ca61c3dd3efcdf1aa5c7ea055514b0985e5fff48.zip |
programmer_init: Work on a mutable copy of programmer params
The signature of extract_param() was wrong all the time. It actually
modifies the passed, global `programmer_param` string. This only com-
piled w/o warnings because of a deficiency of the strstr() API. It
takes a const string as argument but returns a mutable pointer to
a substring of it.
As we take a const parameter string in the libflashrom API and should
not change that, we create a copy in programmer_init() instead.
Now that we free our copy of the programmer parameters at the end of
programmer_init() it's more obvious that the string can only be used
during initialization. So also clear `programmer_param` inside
programmer_init() instead of programmer_shutdown().
Change-Id: If6bb2e5e4312b07f756615984bd3757e92b86b0a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67094
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Diffstat (limited to 'ogp_spi.c')
0 files changed, 0 insertions, 0 deletions