Anonymous | Login | Signup for a new account | 12-17-2024 10:40 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ 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 | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 4.0.0 | Product Version | 4.0.0 | ||||
Product Build | |||||||||
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]; } |
||||||||
Steps To Reproduce | |||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |