Anonymous | Login | Signup for a new account | 12-17-2024 10:52 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0003367 | [Quercus] | minor | always | 03-03-09 22:57 | 03-04-09 16:52 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | nam | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 4.0.0 | ||||||
Summary | 0003367: String indexing fails with binary data | ||||||||
Description |
<?php $x = "\x90"; print $x[0]; Throws an exception: [22:55:30.410] {http--8080-10} java.lang.ArrayIndexOutOfBoundsException: -112 [22:55:30.410] {http--8080-10} at com.caucho.quercus.env.StringBuilderValue.charValueAt(StringBuilderValue.java:733) The following patch fixes it. --- a/modules/quercus/src/com/caucho/quercus/env/StringBuilderValue.java +++ b/modules/quercus/src/com/caucho/quercus/env/StringBuilderValue.java @@ -728,7 +728,7 @@ public class StringBuilderValue if (index < 0 || len <= index) return UnsetStringValue.UNSET; else { - byte ch = _buffer[(int) index]; + int ch = _buffer[(int) index] & 0xff; return CHAR_STRINGS[ch]; } |
||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |