Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3367 | minor | always | 03-03-09 22:57 | 03-04-09 16:52 | |
|
|||||
Reporter: | koreth | Platform: | |||
Assigned To: | nam | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 4.0.0 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in 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]; } |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|