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

Revision 4253, 1.2 KB checked in by sam, 3 years ago (diff)

Fix copyright information and remove Id tag everywhere.

  • Property svn:executable set to *
RevLine 
[2545]1#!/bin/sh
[4253]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#
[2545]13
[2573]14. "$(dirname "$0")/functions.inc"
[2545]15
[4120]16ulimit -c 0
[4119]17
[2545]18PROGRAM="$DIR/bug-overflow"
19if [ ! -f "$PROGRAM" ]; then
20  echo "error: test/bug-overflow is missing"
21  exit 1
22fi
23
[2573]24start_test "zzuf buffer overflow test"
[2545]25
[2573]26new_test "bug-overflow < /file-00"
[2545]27if ! $PROGRAM < "$DIR/file-00"; then
[2573]28    fail_test " unexpected exit status $?"
[2545]29else
[2573]30    pass_test " OK"
[2545]31fi
32
[2573]33new_test "zzuf -qi -r0 bug-overflow < /file-00"
[4120]34if ! $ZZUF -r0 -qi "$PROGRAM" < "$DIR/file-00"; then
[2573]35    fail_test " unexpected exit status $?"
[2545]36else
[2573]37    pass_test " OK"
[2545]38fi
39
[2573]40new_test "zzuf -qi bug-overflow < file-00"
[4120]41if $ZZUF -qi "$PROGRAM" < "$DIR/file-00"; then
[2573]42    fail_test " unexpected exit status $?"
[2545]43else
[2573]44    pass_test " OK"
[2545]45fi
46
[2573]47stop_test
[2545]48
Note: See TracBrowser for help on using the repository browser.