mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 12:55:59 +01:00
Prevent possible null pointer dereference
This commit is contained in:
parent
2918d92280
commit
7a9c7d762c
1 changed files with 7 additions and 5 deletions
|
@ -160,6 +160,7 @@ cmd_info(girara_session_t* session, girara_list_t* UNUSED(argument_list))
|
|||
GString* string = g_string_new(NULL);
|
||||
|
||||
GIRARA_LIST_FOREACH(information, zathura_document_information_entry_t*, iter, entry)
|
||||
if (entry != NULL) {
|
||||
for (unsigned int i = 0; i < LENGTH(meta_fields); i++) {
|
||||
if (meta_fields[i].field == entry->type) {
|
||||
char* text = g_strdup_printf("<b>%s:</b> %s\n", meta_fields[i].name, entry->value);
|
||||
|
@ -167,6 +168,7 @@ cmd_info(girara_session_t* session, girara_list_t* UNUSED(argument_list))
|
|||
g_free(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
GIRARA_LIST_FOREACH_END(information, zathura_document_information_entry_t*, iter, entry);
|
||||
|
||||
if (strlen(string->str) > 0) {
|
||||
|
|
Loading…
Reference in a new issue