Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
7a9c7d76
Commit
7a9c7d76
authored
Apr 01, 2012
by
Moritz Lipp
Browse files
Prevent possible null pointer dereference
parent
2918d922
Changes
1
Hide whitespace changes
Inline
Side-by-side
commands.c
View file @
7a9c7d76
...
...
@@ -160,11 +160,13 @@ 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
)
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
);
g_string_append
(
string
,
text
);
g_free
(
text
);
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
);
g_string_append
(
string
,
text
);
g_free
(
text
);
}
}
}
GIRARA_LIST_FOREACH_END
(
information
,
zathura_document_information_entry_t
*
,
iter
,
entry
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment