File: bug-64316

package info (click to toggle)
diffutils 1%3A3.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,980 kB
  • sloc: ansic: 116,841; sh: 12,881; perl: 535; makefile: 233; sed: 16
file content (31 lines) | stat: -rwxr-xr-x 580 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Test for signed integer overflow bug within diff.
# Bug reported by Gisele Vanem <http://bugs.gnu.org/64316>.
# Compile with gcc -fsanitize=undefined to test for this bug.

. "${srcdir=.}/init.sh"; path_prepend_ ../src

fail=0

for f in a b; do
  printf 'c\nd\ne\nf\ng\n%s\nh\ni\nj\nk\nl\n' $f >$f || framework_failure_
done

cat >exp <<'EOF' || framework_failure_
@@ -3,7 +3,7 @@
 e
 f
 g
-a
+b
 h
 i
 j
EOF

returns_ 1 diff -u a b >out 2>err || fail=1
sed '1,2d' out >out1 || framework_failure_
compare exp out1 || fail=1
compare /dev/null err || fail=1

Exit $fail