Closed
Bug 82097
Opened 24 years ago
Closed 15 years ago
bidi- arabic- potential buffer overrun in nsBidiUtilsImp::Conv_06_FE_WithReverse
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: ftang, Assigned: smontagu)
References
()
Details
Attachments
(1 file)
|
1.90 KB,
patch
|
Details | Diff | Splinter Review |
This code is currently turn off by #ifdef FULL_ARABIC_SHAPING because the code
is not fully reviewed and have a lot of ARB problems.
we should treat this as individual cases from other shaping routines because the
priority is different.
It is currently called by two places-
nsCopySupport::HTMLCopy
and nsFormFrame::UnicodeToNewBytes
| Reporter | ||
Comment 1•24 years ago
|
||
This routine have more problems than the others.
1.
523 PRUnichar buf[8192];
524 PRUint32 len=8192;
525 //reverse the buffer for shaping
526
527 for(i=beginArabic; i<=endArabic; i++) {
528 buf[i-beginArabic]=aSrcUnichars[endArabic-i+beginArabic];
529 }
530 for(i=0; i<=endArabic-beginArabic; i++) {
531 aSrcUnichars[i+beginArabic]=buf[i];
532 }
use a 8192 array. It have the following problem
a. it use 16K on the stack, which is bad
b. there are no code guarantee i-beginArabic < 8192 in line 528
and there are no code guarantee i < 8192 in line 531
if i-beginArabic >= 8192, then we will ABR
if i >= 8192, then we will ABR
Make the buffer bigger didn't address the issue. It simply cause the bug harder
to get reproduced and therefore harder to be fixed.
same issue with
548 PRUnichar numbuf[20];
549 for(i=beginNumeral; i<=endNumeral; i++){
550 numbuf[i-beginNumeral]=buf[endNumeral-i+beginNumeral];
551 }
552 for(i=0;i<=endNumeral-beginNumeral;i++){
553 buf[i+beginNumeral]=numbuf[i];
554 }
same problem, why it is 20?
use a fixed size in stack is bad
there are no code to guarantee i-beginNumeral < 20 in line 550 and there are no
code to guarantee i < 20 in line 553
| Reporter | ||
Updated•24 years ago
|
QA Contact: andreasb → mahar
| Reporter | ||
Updated•24 years ago
|
Component: Internationalization → BiDi Hebrew & Arabic
Comment 3•24 years ago
|
||
Mass-move all BiDi Hebrew and Arabic qa to me, zach@zachlipton.com.
Thank you Gilad for your service to this component, and best of luck to you
in the future.
Sholom.
QA Contact: mahar → zach
| Assignee | ||
Comment 5•24 years ago
|
||
This has been superseded by the checkin of bug 92797. Not marking FIXED in this
case, since I don't see that the issues raised here have been resolved.
| Assignee | ||
Comment 6•24 years ago
|
||
Changing summary (since this has been turned on anyway)
Summary: bidi- arabic- need to turn on nsBidiUtilsImp::Conv_06_FE_WithReverse → bidi- arabic- potential buffer overrun in nsBidiUtilsImp::Conv_06_FE_WithReverse
Comment 7•24 years ago
|
||
| Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 8•22 years ago
|
||
Kindly be informed that Ahmad A. Abu-Taha (ahtaha@eg.ibm.com) from IBM Egypt is
replacing Maha Abou El-Rous (mahar@eg.ibm.com) in monitoring and receiving
notifications of Mozilla bugs regarding Arabic.
Comment 9•19 years ago
|
||
anyone know if the patch is still good? mats, can you take a look?
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: mahar → layout.fonts-and-text
| Assignee | ||
Comment 10•15 years ago
|
||
Fixed by removing the code in bug 545059
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•