mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:33:23 +00:00
Fix incorrect memory access in nickname handling
There was one code path where we didn't strdup the nickname - and this got triggered when parsing XML files with divecomputerid entries for dive computers that were already in the config. The nickname is then replaced with the nickname from the parser - and that memory is later reused... We should cleanup that nickname, anyway, and that also takes care of making sure we have our own copy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fd03fcd66d
commit
f6fb882337
1 changed files with 1 additions and 1 deletions
|
@ -2188,7 +2188,7 @@ void remember_dc(const char *model, uint32_t deviceid, const char *nickname, gbo
|
|||
struct dcnicknamelist *nn_entry = get_dc_nicknameentry(model, deviceid);
|
||||
if (!nn_entry->model || !*nn_entry->model)
|
||||
nn_entry->model = model;
|
||||
nn_entry->nickname = nickname;
|
||||
nn_entry->nickname = cleanedup_nickname(nickname, 80);
|
||||
replace_nickname_nicknamestring(model, deviceid, nickname);
|
||||
}
|
||||
#if defined(NICKNAME_DEBUG)
|
||||
|
|
Loading…
Add table
Reference in a new issue