summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-01-05 11:45:37 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-05 11:45:37 +0100
commit96a40c97cedeb51ab70cedd6b863388610338862 (patch)
tree973dfccc86491a9863f5a3ca8e9a11dfe9af17cc /src
parent64a4c3767cf5a395bfe5157dd4bc144caebf270f (diff)
Added a test for NULL when freeing subj->last_delim.
Noticed the need for this through fuzzing.
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/inlines.c b/src/inlines.c
index a855c5a..7263c05 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -600,7 +600,7 @@ static void process_emphasis(subject *subj, delimiter *stack_bottom) {
}
}
// free all delimiters in list until stack_bottom:
- while (subj->last_delim != stack_bottom) {
+ while (subj->last_delim != NULL && subj->last_delim != stack_bottom) {
remove_delimiter(subj, subj->last_delim);
}
}