exec.c, compat.c: fix count(), compat_count() bounds checking
[linux-2.6-block.git] / fs / exec.c
index cecee501ce78805c32c9d007c658fce1e87b0a97..7b5ed50eadeb95daf8c4617c9372ceb5f2878245 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -391,7 +391,7 @@ static int count(char __user * __user * argv, int max)
                        if (!p)
                                break;
                        argv++;
-                       if(++i > max)
+                       if (i++ >= max)
                                return -E2BIG;
                        cond_resched();
                }