From: Dan Winship Date: Fri, 3 Nov 2006 18:32:16 +0000 (+0000) Subject: Fix an off by one pointed out by Andrew W. Nosenko. X-Git-Tag: LIBSOUP_2_2_97~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fd416b5e337457a7bf0499c66bd85dd2c24825e;p=platform%2Fupstream%2Flibsoup.git Fix an off by one pointed out by Andrew W. Nosenko. * libsoup/soup-uri.c (soup_uri_get_protocol): Fix an off by one pointed out by Andrew W. Nosenko. --- diff --git a/ChangeLog b/ChangeLog index 8009d00..fc4b203 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ * libsoup/soup-server.c (get_property): Fix leaks pointed out by Paolo Borelli. #351500 + * libsoup/soup-uri.c (soup_uri_get_protocol): Fix an off by one + pointed out by Andrew W. Nosenko. + * configure.in: Use pkgconfig to find gnutls. Remove old static linking stuff that was only needed for rcd. diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c index e04baed..ecbf6a9 100644 --- a/libsoup/soup-uri.c +++ b/libsoup/soup-uri.c @@ -18,7 +18,7 @@ soup_uri_get_protocol (const char *proto, int len) { char proto_buf[128]; - g_return_val_if_fail (len < sizeof (proto_buf), 0); + g_return_val_if_fail (len < sizeof (proto_buf) - 1, 0); memcpy (proto_buf, proto, len); proto_buf[len] = '\0';