summaryrefslogtreecommitdiff
path: root/pdf/pdf_annot.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-22 10:38:48 +0000
committerRobin Watts <robin@ghostscript.com>2011-12-22 10:41:57 +0000
commit3145e49a9ce16d45bf4d6bb01c64646f41d70e8f (patch)
tree7bb42208bc4c841ea11b2f9c55b5140fec304a26 /pdf/pdf_annot.c
parentfef4974f61698e929eb9be2a417fd3743bbd5d35 (diff)
downloadmupdf-3145e49a9ce16d45bf4d6bb01c64646f41d70e8f.tar.xz
Fix Bug 692756: SEGVs in pdf_annot and pdf_outline
A couple of bits of the code SEGV in the event that values are NULL. Fixed here by converting a do...while to a while, and adding an extra guard in the if. Thanks to Gaetan Bisson for the report, and patch.
Diffstat (limited to 'pdf/pdf_annot.c')
-rw-r--r--pdf/pdf_annot.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pdf/pdf_annot.c b/pdf/pdf_annot.c
index 84b403fe..79bdb4ff 100644
--- a/pdf/pdf_annot.c
+++ b/pdf/pdf_annot.c
@@ -6,7 +6,7 @@ pdf_free_link(fz_context *ctx, pdf_link *link)
{
pdf_link *next;
- do
+ while (link)
{
next = link->next;
if (link->dest)
@@ -14,7 +14,6 @@ pdf_free_link(fz_context *ctx, pdf_link *link)
fz_free(ctx, link);
link = next;
}
- while(link);
}
static fz_obj *