[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Out of bounds array access in hooks.c

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2007-12-11 17:41:20 CET

Karl Fogel <kfogel@red-bean.com> writes:

> Thanks, Daniel and David. That was my bad, I think. It passed all my
> testing too; I have no idea what the compiler was doing with array
> allocation such that there was always room, but I wish it hadn't :-).

You could use this technique:

   int i = 0;
   const char *args[3];

   args[i++] = ...;
   args[i++] = ...;
   args[i++] = ...;

   assert(i == sizeof(args)/sizeof(args[0]));

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 11 17:41:34 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.