mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix SIGSEGV if no pre-existing nickname information
Loading an xml file with dive computer information without any
preexisting nickname data would try to "remember" that NULL nickname.
Causing a SIGSEGV if there was no nickname information.
The bug was introduced by commit ec38d3708d
("Move device_info handling
into a new 'device.c' file") when I inadvertently removed a bit too much
code. It actually wants to remember a missing DC nickname as an empty one.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e8a896b64d
commit
c44755878c
1 changed files with 3 additions and 0 deletions
|
@ -1737,6 +1737,9 @@ void remember_dc(const char *model, uint32_t deviceid, const char *nickname, gbo
|
|||
if (!nn_entry)
|
||||
return;
|
||||
|
||||
if (!nickname)
|
||||
nickname = "";
|
||||
|
||||
/* No existing nickname? */
|
||||
if (!nn_entry->nickname) {
|
||||
char buffer[160];
|
||||
|
|
Loading…
Add table
Reference in a new issue