segment: Fix 1-byte read past initialized data when file ends in CR.
[pspp] / tests / language / lexer / segment.at
index 78ad1e99eb5843b81fc9e432119d56335b7a6dc3..abbc08c8cd4b4a037b7f7155ccc799b0cdde6593 100644 (file)
@@ -1643,3 +1643,16 @@ end
 ])
 PSPP_CHECK_SEGMENT([-a])
 AT_CLEANUP
+\f
+# This checks for regression against bug #61253.  To see the read of
+# uninitialized data, run with valgrind.  The test will pass either
+# way.  (The bug report has a more complicated crashing case.)
+AT_SETUP([input ends in carriage return])
+printf '\r' > input
+AT_DATA([expout-base], [dnl
+separate_commands
+spaces          \r
+end
+])
+PSPP_CHECK_SEGMENT
+AT_CLEANUP