r7001 chris_y - /trunk/netsurf/desktop/browser.c

John-Mark Bell jmb at netsurf-browser.org
Tue Mar 31 00:01:17 BST 2009


On Mon, 2009-03-30 at 18:10 +0000, netsurf at semichrome.net wrote:
> Author: chris_y
> Date: Mon Mar 30 13:10:16 2009
> New Revision: 7001
> 
> URL: http://source.netsurf-browser.org?rev=7001&view=rev
> Log:
> Stop URL bar losing characters on every refresh
> 
> Modified:
>     trunk/netsurf/desktop/browser.c
> 
> Modified: trunk/netsurf/desktop/browser.c
> URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/browser.c?rev=7001&r1=7000&r2=7001&view=diff
> ==============================================================================
> --- trunk/netsurf/desktop/browser.c (original)
> +++ trunk/netsurf/desktop/browser.c Mon Mar 30 13:10:16 2009
> @@ -1096,11 +1096,11 @@
>  	url_buf = malloc(len + 2 /* '#' + '\0' */);
>  	if (url_buf) {
>  		if (frag) {
> -			snprintf(url_buf, len + 1, "%s#%s", url, frag);
> +			snprintf(url_buf, len + 2, "%s#%s", url, frag);
> +			*(url_buf + len + 2) = '\0';

Either I'm being stupid, or this now writes one byte past the end of the
buffer.


J.




More information about the netsurf-dev mailing list