source: zzuf/trunk/test/check-overflow @ 4253

Last change on this file since 4253 was 4253, checked in by sam, 4 years ago

Fix copyright information and remove Id tag everywhere.

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/sh
2#
3#  check-overflow - check that zzuf catches buffer overflows
4#  Copyright (c) 2008-2010 Sam Hocevar <sam@hocevar.net>
5#                All Rights Reserved
6#
7#  This program is free software. It comes without any warranty, to
8#  the extent permitted by applicable law. You can redistribute it
9#  and/or modify it under the terms of the Do What The Fuck You Want
10#  To Public License, Version 2, as published by Sam Hocevar. See
11#  http://sam.zoy.org/wtfpl/COPYING for more details.
12#
13
14. "$(dirname "$0")/functions.inc"
15
16ulimit -c 0
17
18PROGRAM="$DIR/bug-overflow"
19if [ ! -f "$PROGRAM" ]; then
20  echo "error: test/bug-overflow is missing"
21  exit 1
22fi
23
24start_test "zzuf buffer overflow test"
25
26new_test "bug-overflow < /file-00"
27if ! $PROGRAM < "$DIR/file-00"; then
28    fail_test " unexpected exit status $?"
29else
30    pass_test " OK"
31fi
32
33new_test "zzuf -qi -r0 bug-overflow < /file-00"
34if ! $ZZUF -r0 -qi "$PROGRAM" < "$DIR/file-00"; then
35    fail_test " unexpected exit status $?"
36else
37    pass_test " OK"
38fi
39
40new_test "zzuf -qi bug-overflow < file-00"
41if $ZZUF -qi "$PROGRAM" < "$DIR/file-00"; then
42    fail_test " unexpected exit status $?"
43else
44    pass_test " OK"
45fi
46
47stop_test
48
Note: See TracBrowser for help on using the repository browser.