Skip to content

Commit f37194e

Browse files
InterLinked1jcolp
authored andcommitted
func_presencestate: Fix invalid memory access.
When parsing information from AstDB while loading, it is possible that certain pointers are never set, which leads to invalid memory access and then, fatally, invalid free attempts on this memory. We now initialize to NULL to prevent this. ASTERISK-30311 #close Change-Id: I6120681d04fd2c12a9473f35ce95a1f8e74e3929
1 parent 48b5a4d commit f37194e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

funcs/func_presencestate.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,8 @@ static int load_module(void)
850850
for (; db_entry; db_entry = db_entry->next) {
851851
const char *dev_name = strrchr(db_entry->key, '/') + 1;
852852
enum ast_presence_state state;
853-
char *message;
854-
char *subtype;
853+
char *message = NULL;
854+
char *subtype = NULL;
855855
if (dev_name <= (const char *) 1) {
856856
continue;
857857
}

0 commit comments

Comments
 (0)