On 07/ 1/13 10:04 AM, Julien Cristau wrote:
Avoid dereferencing argv[argc].

See 
http://www.forallsecure.com/bug-reports/011f1a55f79a5501b36008d6ee0d40e8b6644569/

Reported-by: Alexandre Rebert <alexan...@cmu.edu>
Signed-off-by: Julien Cristau <jcris...@debian.org>
---
  main.c |   16 ++++++++++++++++
  1 file changed, 16 insertions(+)

diff --git a/main.c b/main.c
index e42b0cf..6ccb09b 100644
--- a/main.c
+++ b/main.c
@@ -242,6 +242,8 @@ main(int argc, char *argv[])
                        break;
                case 'D':
                        if (argv[0][2] == '\0') {
+                                if (argc < 2)
+                                       fatalerr("Missing argument for -D\n");

Code is fine, but it appears that you've used spaces on the if line &
tabs on the fatalerr() line in each place, making the indentation look
funny in a few spots - would be nice to do a quick global-replace to
clean that up.

Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com>

--
        -Alan Coopersmith-              alan.coopersm...@oracle.com
         Oracle Solaris Engineering - http://blogs.oracle.com/alanc


--
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/51d20ebd.1020...@oracle.com

Reply via email to