about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-10-29 01:31:37 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-10-29 01:31:37 +0000
commit789b8e56efb93cbf2d58c4c1eaa5d08ca73cd17a (patch)
tree98eacb833555d2d10868a17f62f4ac654173f65f
parent52a752e4e8e76be31f0868c337738afb55568eb4 (diff)
downloadnetpbm-mirror-789b8e56efb93cbf2d58c4c1eaa5d08ca73cd17a.tar.gz
netpbm-mirror-789b8e56efb93cbf2d58c4c1eaa5d08ca73cd17a.tar.xz
netpbm-mirror-789b8e56efb93cbf2d58c4c1eaa5d08ca73cd17a.zip
Release 10.73.17
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3094 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/ppm/sldtoppm.c40
-rw-r--r--doc/HISTORY12
-rw-r--r--version.mk2
3 files changed, 33 insertions, 21 deletions
diff --git a/converter/ppm/sldtoppm.c b/converter/ppm/sldtoppm.c
index 6ba4cb40..550eed5b 100644
--- a/converter/ppm/sldtoppm.c
+++ b/converter/ppm/sldtoppm.c
@@ -196,7 +196,7 @@ slidefind(const char * const sname,
     /* Read slide library header and verify. */
     
     if ((fread(libent, 32, 1, slfile) != 1) ||
-        (!streq((char *)libent, "AutoCAD Slide Library 1.0\015\012\32"))) {
+        (!strneq((char *)libent, "AutoCAD Slide Library 1.0\015\012\32", 32))) {
         pm_error("not an AutoCAD slide library file.");
     }
     pos = 32;
@@ -208,29 +208,29 @@ slidefind(const char * const sname,
         readCt = fread(libent, 36, 1, slfile);
         if (readCt != 1)
             eof = true;
-        else if (strlen((char *)libent) == 0)
+        else if (strnlen((char *)libent, 32) == 0)
             eof = true;
-    }
-    if (!eof) {
-        pos += 36;
-        if (dironly) {
-            pm_message("  %s", libent);
-        } else if (streq((char *)libent, uname)) {
-            long dpos;
-
-            dpos = (((((libent[35] << 8) | libent[34]) << 8) |
-                     libent[33]) << 8) | libent[32];
-
-            if ((slfile == stdin) || (fseek(slfile, dpos, 0) == -1)) {
-                dpos -= pos;
+
+        if (!eof) {
+            pos += 36;
+            if (dironly) {
+                pm_message("  %s", libent);
+            } else if (strneq((char *)libent, uname, 32)) {
+                long dpos;
+
+                dpos = (((((libent[35] << 8) | libent[34]) << 8) |
+                         libent[33]) << 8) | libent[32];
         
-                while (dpos-- > 0)
-                    getc(slfile);
+                if ((slfile == stdin) || (fseek(slfile, dpos, 0) == -1)) {
+                    dpos -= pos;
+
+                    while (dpos-- > 0)
+                        getc(slfile);
+                }
+                found = true;
             }
-            found = true;
         }
     }
-
     if (!found && !dironly)
         pm_error("slide '%s' not in library.", sname);
 }
@@ -350,7 +350,7 @@ slider(slvecfn   slvec,
 
     /* Verify that slide format is compatible with this program. */
 
-    if (streq(slfrof.slh, slhi.slh))
+    if (!STRSEQ(slfrof.slh, slhi.slh))
         pm_error("this is not an AutoCAD slide file.");
 
     /* Verify that the number format and file level in the header  are
diff --git a/doc/HISTORY b/doc/HISTORY
index 3911d9c7..d9fab8a1 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,18 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+17.10.28 BJH  Release 10.73.17
+
+              sldtoppm: -lib and -dir don't work - always says slide not
+              found.  Broken in Netpbm 10.63 (June 2013).
+
+              sldtoppm: fix bug: says AutoCAD slide file isn't an AutoCAD
+              slide file.  Broken after Netpbm 10.26 (January 2005), but no
+              later than 10.35 (August 2006).
+
+              sldtoppm: fix bug: wild memory accesses, weird messages when
+              invalid input file has unterminated strings.
+              
 17.09.28 BJH  Release 10.73.16
 
               ppmbrighten: fix bug: red pixels change hue.  Introduced in
diff --git a/version.mk b/version.mk
index d23ea7fc..e7e1df61 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 73
-NETPBM_POINT_RELEASE = 16
+NETPBM_POINT_RELEASE = 17