about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Makefile.version2
-rw-r--r--doc/HISTORY7
-rw-r--r--generator/pbmtextps.c3
-rw-r--r--lib/libpam.c4
4 files changed, 12 insertions, 4 deletions
diff --git a/Makefile.version b/Makefile.version
index f5d9fcf1..2269afb3 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 35
-NETPBM_POINT_RELEASE = 20
+NETPBM_POINT_RELEASE = 21
diff --git a/doc/HISTORY b/doc/HISTORY
index 00580f13..bc91e1d8 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,13 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+06.12.31 BJH  Release 10.35.21
+
+              libnetpbm: fix crash with PAM read as PNM.
+
+              pbmtextps: Fix buffer overrun -- typical symptom: extra
+              text generated.
+
 06.12.18 BJH  Release 10.35.20
 
               ppmchange: Fix bug with -closeness and not -remainder or
diff --git a/generator/pbmtextps.c b/generator/pbmtextps.c
index ef8ae008..08c77564 100644
--- a/generator/pbmtextps.c
+++ b/generator/pbmtextps.c
@@ -93,7 +93,8 @@ parseCommandLine(int argc, char ** argv,
 
     optParseOptions3(&argc, argv, opt, sizeof(opt), 0);
 
-    text = NULL;
+    text = strdup("");
+    totaltextsize = 1;
 
     for (i = 1; i < argc; i++) {
         if (i > 1) {
diff --git a/lib/libpam.c b/lib/libpam.c
index 60d446d9..f8d0be6e 100644
--- a/lib/libpam.c
+++ b/lib/libpam.c
@@ -679,9 +679,9 @@ pnm_readpaminitrestaspnm(FILE * const fileP,
 -----------------------------------------------------------------------------*/
     struct pam pam;
 
-    pam.size        = PAM_STRUCT_SIZE(tuple_type);
+    pam.size        = sizeof(struct pam);
     pam.file        = fileP;
-    pam.len         = sizeof(struct pam);
+    pam.len         = PAM_STRUCT_SIZE(tuple_type);
     pam.format      = PAM_FORMAT;
 
     readpaminitrest(&pam);