session: Fix crash when the UCI option 'password' or 'username' is missing master
authorIssamHamdi <ih@simonwunderlich.de>
Tue, 28 May 2024 13:58:29 +0000 (15:58 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 28 May 2024 17:03:57 +0000 (18:03 +0100)
commitbcc091d2f15c8ec258488964abfb335c9e969153
tree9290c7a67e8ed67dd449d65620fa112f47d03c78
parent8ef4c2587ac0041049c67befed281a70cf240769
session: Fix crash when the UCI option 'password' or 'username' is missing

Add a check in 'ptr.o' to prevent a crash in the
'if (ptr.o->type != UCI_TYPE_STRING)' statement
when ptr.o is null. This issue occurs due to the
absence of 'password' or 'username' in the login
section of /etc/config/rpcd.

Signed-off-by: IssamHamdi <ih@simonwunderlich.de>
session.c