shithub: libmujs

Download patch

ref: 90c2ba0bf311101b59097b16bff4fc63016eb392
parent: 32ac46df1537af92a08377fe4ac31b55fa759a59
author: Tor Andersson <tor@ccxvii.net>
date: Wed Feb 26 11:00:23 EST 2014

Nul-terminate strings created by toUpper/LowerCase.

--- a/jsstring.c
+++ b/jsstring.c
@@ -232,6 +232,7 @@
 		rune = tolowerrune(rune);
 		d += runetochar(d, &rune);
 	}
+	*d = 0;
 	if (js_try(J)) {
 		free(dst);
 		js_throw(J);
@@ -253,6 +254,7 @@
 		rune = toupperrune(rune);
 		d += runetochar(d, &rune);
 	}
+	*d = 0;
 	if (js_try(J)) {
 		free(dst);
 		js_throw(J);