about summary refs log tree commit diff
path: root/lib/libpbmfont.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpbmfont.c')
-rw-r--r--lib/libpbmfont.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libpbmfont.c b/lib/libpbmfont.c
index c7b5a355..54cae478 100644
--- a/lib/libpbmfont.c
+++ b/lib/libpbmfont.c
@@ -1132,5 +1132,17 @@ int mk_max;
             s++;
     }
     vec[n] = 0;
+
+    /* Caller expects there to be at least one element in vec[], so we
+       can't return an empty line.  More advanced releases of Netpbm
+       just ignore blank lines.  If important, we can fairly easily port
+       the required code back to this release, by replacing readline()
+       with a current one, modified somewhat so it compiles here.
+
+       - Bryan 2010.03.23 
+    */
+    if (n < 1)
+        pm_error("Invalid font file -- contains a blank line");
+
     return n;
 }