Package list unrtf / 195636a
attr_get_param(): Silence a warning message again Willi Mann 6 years ago
2 changed file(s) with 33 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 From: Fabian Keil <fk@fabiankeil.de>
1 Date: Thu, 4 Dec 2014 18:20:12 +0100
2 Subject: attr_get_param(): Silence a warning message again
3
4 attr_get_param(ATTR_ENCODING) is always called once without a stack
5 being available, but previously the use-after-free prevented the
6 warning.
7 ---
8 src/attr.c | 10 ++++++++--
9 1 file changed, 8 insertions(+), 2 deletions(-)
10
11 diff --git a/src/attr.c b/src/attr.c
12 index 2c2552b..0337fd0 100644
13 --- a/src/attr.c
14 +++ b/src/attr.c
15 @@ -348,8 +348,14 @@ attr_get_param(int attr)
16 int i;
17 AttrStack *stack = stack_of_stacks_top;
18 if (!stack) {
19 - warning_handler("No stack to get attribute from");
20 - return;
21 + if (attr != ATTR_ENCODING) {
22 + /*
23 + * attr_get_param(ATTR_ENCODING) is always called
24 + * called once without a stack being available.
25 + */
26 + warning_handler("No stack to get attribute from");
27 + }
28 + return NULL;
29 }
30
31 i=stack->tos;
11 0002-Need-to-process-word-chars-as-unsigned.-Else-char-wi.patch
22 0003-Fix-a-number-of-possible-crashes-caused-by-a-bad-for.patch
33 0004-attrstack_drop-Properly-drop-the-last-stack-element.patch
4 0005-attr_get_param-Silence-a-warning-message-again.patch