> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff Trawick
> Sent: 12 March 2002 13:56

> "Sander Striker" <[EMAIL PROTECTED]> writes:
> 
> > Jeff,
> > 
> > Does this resolve the issue you added the comment for?
> 
> no
> 
> 1) the strncpy() can go beyond the allocated storage for the buffer

How so?  I substract the taglen from the total buffer length before
reading the file, so it should be ok to copy the tag to the end.

> 2) no terminating '\0' for the copy of the tag, so strstr() can't work
>    anyway 

>From the strstr man page:

SYNOPSIS
       #include <string.h>

       char *strstr(const char *haystack, const char *needle);

DESCRIPTION
       The  strstr()  function finds the first occurrence of the substring needle
       in the string haystack.  The terminating `\0' characters are not compared.


What am I missing?

Sander

Reply via email to