On Fri, Nov 07, 2014 at 04:20:46AM +1100, Joshua Rogers wrote:
> >                 filenamelen += strlen(dsdir) + 1;
>
> The last line, "sprintf(filename, "%s/", dsdir);".
> Since "/" is also added to the buffer, doesn't that mean the buffer will
> be overflowed by one byte if the dsdir is full?

The allocated buffer size is "filenamelen + 1", which includes space for
"strlen(dsdir) + 1" if dsdir is not NULL.

The first "+ 1" is there to make room for a null terminator; the second
is there to make room for the slash.

-- 
Evan Hunt -- [email protected]
Internet Systems Consortium, Inc.
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to