Add a test for bug #58591
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 14:11:32 +0000 (16:11 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 14:41:27 +0000 (16:41 +0200)
src/libpspp/u8-line.c
tests/output/ascii.at

index 3b4f9c60c4d2e55ea7503bf89bc3d80fc0801c33..1374314a11fb377c8f6e7e95b751738426f16c8d 100644 (file)
@@ -122,6 +122,9 @@ u8_line_find_pos (const struct u8_line *line, int target_x, struct u8_pos *c)
         }
       x += w;
     }
         }
       x += w;
     }
+
+  /* This can happen if there are non-printable characters
+     in the line.  */
   c->x1 = x;
   c->ofs1 = ofs;
   return false;
   c->x1 = x;
   c->ofs1 = ofs;
   return false;
index fb7a8969dcff62d24f08724005fc0d5023c45f61..f966fc6f061950286f0338213f3e0681a13949ea 100644 (file)
@@ -688,3 +688,22 @@ execute.
 AT_CHECK([pspp print.sps], [0], [ignore])
 
 AT_CLEANUP
 AT_CHECK([pspp print.sps], [0], [ignore])
 
 AT_CLEANUP
+
+
+
+dnl A crash has been observed when the first character
+dnl of a string is U+0008
+AT_SETUP([ASCII crash on non-printables])
+
+AT_DATA([nonprint.sps], [dnl
+DATA LIST FREE /s8 (a8).
+BEGIN DATA.
+xxxxxx zzz  \ba qqq
+END DATA.
+
+LIST.
+])
+
+AT_CHECK([pspp nonprint.sps], [0], [ignore])
+
+AT_CLEANUP