[Piglit] [PATCH] egl: fix egl-query-surface argv parsing
Chad Versace
chad.versace at linux.intel.com
Wed Nov 16 13:26:39 PST 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/15/2011 02:09 PM, nobled wrote:
> This fixes:
> 1. If you passed any option not recognized by egl-query-surface,
> but that *is* recognized by egl_util_run() like '-auto', it would
> usually fail with usage().
> 2. If it didn't fail, it was because the loop skips over the next
> argument after it finds one it recognizes.
> 3. If a recognized argument is the last/only argument in argv,
> egl_util_run() would segfault with a null deref in strcmp() because
> argc would be off by one, because of problem 2.
>
> The only way the test didn't crash or fail was if two arguments
> were passed in this exact order:
>
> bin/egl-query-surface --bad-surface -auto
> ---
> tests/egl/egl-query-surface.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
Thanks for fixing this. Next time I write a parse_args() functions, I
promise to verify that it correctly handles unexpected input.
Reviewed-by: Chad Versace <chad.versace at linux.intel.co>
- ----
Chad Versace
chad.versace at linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJOxCqNAAoJEAIvNt057x8i8OwP/0X6XgraWegBjRoDJFK7VAWn
+VTj5Smz/VUWLZW2y60JA7KcOsggikVJVMfOR6FLciaKr9KvstcJFMp4XMtqG0M0
MaMYtPsp+h84qDzcLUCIMj8Z0YU7wQCIEd7HvttgWCHpMGzy9dr9qQPs7ovELTQw
DxuG7DaErZUQfidQQVmmJg8gZ52kfAemKzEbQHetC5U43xdC438oxkPVus073JSb
S7tvW2mYJxE9earnYu4jnFqN1KZRs8qtsObtHaP8DDKxs2p30fZMQkBYMwBfcdOQ
+oi1FD45QbGdxHBuKlidojTVF7zyNBPAsNG6dw+Azyr/9Rw5DjFM4Tbi4+rN3rY/
OFGlAvI4B7zl55l1PEhlfW61k/wMetAsiAjyLIThfN3j1GjXN9kEw8UjCZPMehXu
XOH1JOUBmBZcDE+mZQVz/78jNL4hOIg0vbE45aDbbk+BTRFR4O1v+YhzEIUGTSHW
pTlG5a3SYYq/u2AwkCiKYlU26A/HuXs0uYJav/p4HGfeIR7XhG1uH+HmJFNAdHPf
JS7wMmg3RzbB3qQ6jkjlQENmhaB5N+p6b5MliXc3lXiww4ZKJkXHPizgofaJyLbP
erOVLNhxHTvsVnJeX+fWJRcyvs9YUB8mjsOVfJO50nOd52/NoTm089B8AsAie2sN
CNwhsQJKBL98t4Q8+Toe
=0ewX
-----END PGP SIGNATURE-----
More information about the Piglit
mailing list