Prevent access beyond boundaries of array on fallthrough 224/head
authorNHOrus <jy6x2b32pie9@yahoo.com>
Fri, 7 Jul 2017 20:14:46 +0000 (23:14 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Fri, 7 Jul 2017 20:15:54 +0000 (23:15 +0300)
main.c

diff --git a/main.c b/main.c
index 0b3663940c05c75d82b28918742a752864c3067c..200c77ebc3d0bf4a541e3c206e6571a2a8d74f80 100644 (file)
--- a/main.c
+++ b/main.c
@@ -648,8 +648,8 @@ static void playermove( int motion)
                         /* else fall through */
                     }
                     /* YAML [with OBJ] clause */
-                    if (TOTING(condarg1) ||
-                        (condtype == cond_with && AT(condarg1)))
+                    else if (TOTING(condarg1) ||
+                             (condtype == cond_with && AT(condarg1)))
                         break;
                     /* else fall through to check [not OBJ STATE] */
                 } else if (game.prop[condarg1] != condarg2)