mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
commit 908ee4dc96 ("build: remove clang
unused variable assignment warnings") introduced an error:
```
- tmp_str_ptr += sprintf(tmp_str_ptr, "%s", name);
+ sprintf(tmp_str_ptr, "%s", name);
sprintf(tmp_str_ptr, "%s", temp->name);
```
This results in `name` being overwritten by `temp->name`.
Fix this, adding OOM handling along the way.
Change-Id: Id41f73247c3f7e6194d7c92187ad3163a9ea6c89
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8761
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>