Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: 0.95.1 bug summary [gcfclient]




 As a note, if you are going to use strncpy (which is a good idea, you should
add something like:


> -  strcpy (last_str, str);
> +  strncpy (last_str, str, MAX_BUF-1);

 last_str[MAX_BUF-1] = '\0';

 Otherwise the string is may not be null terminated (will not be in cases for
which you are preventing the buffer overflow), which will probably cause many
other unexpected behaviour to come up.


-- 

-- Mark Wedel
mark@pyramid.com
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]