aboutsummaryrefslogtreecommitdiff
path: root/src/whirligig.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-06-16 17:29:17 +0200
committerThomas White <taw@physics.org>2015-01-29 13:23:37 +0100
commit07af79bf63973ed728a3fd4ded1369e359e7c79d (patch)
tree8130caf442dee936ff386b54cce79fad77644201 /src/whirligig.c
parentfbfd6e7a78089f99ebff3a98b2816ad4d0b571ca (diff)
Prevent read past start of array
Diffstat (limited to 'src/whirligig.c')
-rw-r--r--src/whirligig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/whirligig.c b/src/whirligig.c
index ea78edb8..2d36839b 100644
--- a/src/whirligig.c
+++ b/src/whirligig.c
@@ -311,7 +311,7 @@ int main(int argc, char *argv[])
pos--;
}
- if ( (ser[pos] == -1) && (ser[pos-1] == -1) ) {
+ if ( (pos > 0) && (ser[pos] == -1) && (ser[pos-1] == -1) ) {
/* Series ready to process */
process_series(win, ser, mat, pos-2);
dump(win, ser, mat, window_len, pos);