Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 172746 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-3 / +10 lines)
Line  Link Here
0
-----------------------------------------------------------------------
0
++ kjs/function.cpp
1
-----------------------------------------------------------------------
2
-- kjs/function.cpp
Lines 244-254 UString decodeURI(ExecState *exec, UStri Link Here
244
      }
244
      }
245
245
246
      // UTF-8 transform
246
      // UTF-8 transform
247
      const unsigned long replacementChar = 0xFFFD;
247
      unsigned long V;
248
      unsigned long V;
248
      if (n == 2) {
249
      if (n == 2) {
249
	unsigned long yyyyy = octets[0] & 0x1F;
250
	unsigned long yyyyy = octets[0] & 0x1F;
250
	unsigned long zzzzzz = octets[1] & 0x3F;
251
	unsigned long zzzzzz = octets[1] & 0x3F;
251
	V = (yyyyy << 6) | zzzzzz;
252
	V = (yyyyy << 6) | zzzzzz;
253
	// 2-byte sequence overlong for this value?
254
	if (V < 0xFF)
255
	  V = replacementChar;
252
	C = UChar((unsigned short)V);
256
	C = UChar((unsigned short)V);
253
      }
257
      }
254
      else if (n == 3) {
258
      else if (n == 3) {
Lines 256-261 UString decodeURI(ExecState *exec, UStri Link Here
256
	unsigned long yyyyyy = octets[1] & 0x3F;
260
	unsigned long yyyyyy = octets[1] & 0x3F;
257
	unsigned long zzzzzz = octets[2] & 0x3F;
261
	unsigned long zzzzzz = octets[2] & 0x3F;
258
	V = (xxxx << 12) | (yyyyyy << 6) | zzzzzz;
262
	V = (xxxx << 12) | (yyyyyy << 6) | zzzzzz;
263
	// 3-byte sequence overlong for this value,
264
	// an invalid value or UTF-16 surrogate?
265
	if (V < 0x800 || V == 0xFFFE || V == 0xFFFF ||
266
	    (V >= 0xD800 && V <= 0xDFFF))
267
	  V = replacementChar;
259
	C = UChar((unsigned short)V);
268
	C = UChar((unsigned short)V);
260
      }
269
      }
261
      else {
270
      else {

Return to bug 172746