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>
This commit is contained in:
parent
8ef4c2587a
commit
bcc091d2f1
1 changed files with 6 additions and 0 deletions
|
@ -862,6 +862,9 @@ rpc_login_test_login(struct uci_context *uci,
|
|||
if (uci_lookup_ptr(uci, &ptr, NULL, true))
|
||||
continue;
|
||||
|
||||
if (!ptr.o)
|
||||
continue;
|
||||
|
||||
if (ptr.o->type != UCI_TYPE_STRING)
|
||||
continue;
|
||||
|
||||
|
@ -880,6 +883,9 @@ rpc_login_test_login(struct uci_context *uci,
|
|||
if (uci_lookup_ptr(uci, &ptr, NULL, true))
|
||||
continue;
|
||||
|
||||
if (!ptr.o)
|
||||
continue;
|
||||
|
||||
if (ptr.o->type != UCI_TYPE_STRING)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue