summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch/util.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-02-02 09:16:37 +0000
committerbde <bde@FreeBSD.org>1997-02-02 09:16:37 +0000
commitee7d1d310f9ef46e5784e0edb991a58c70253a25 (patch)
tree899f550974a71e4b73ad90193fa82cb1e2a3bd46 /usr.bin/fetch/util.c
parentfb04f87834966198d7dd83261bf4d3f6e51d6149 (diff)
downloadFreeBSD-src-ee7d1d310f9ef46e5784e0edb991a58c70253a25.zip
FreeBSD-src-ee7d1d310f9ef46e5784e0edb991a58c70253a25.tar.gz
Null-terminate the string in percent_decode() so that we don't depend on
malloc() returning zeroed storage or dump core while starting up. Found-by: /etc/malloc.conf ->AJ
Diffstat (limited to 'usr.bin/fetch/util.c')
-rw-r--r--usr.bin/fetch/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/fetch/util.c b/usr.bin/fetch/util.c
index 08103a0..aab9278 100644
--- a/usr.bin/fetch/util.c
+++ b/usr.bin/fetch/util.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: util.c,v 1.1 1997/01/30 21:43:44 wollman Exp $
*/
#include <sys/types.h>
@@ -148,6 +148,7 @@ percent_decode(const char *uri)
*s++ = *uri++;
}
}
+ *s = '\0';
return rv;
}
OpenPOWER on IntegriCloud