Closed Bug 173553 Opened 20 years ago Closed 20 years ago

flawfinder warnings in editor/libeditor/html/nsHTMLEditorLog.cpp

Categories

(Core :: DOM: Editor, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED
mozilla1.3alpha

People

(Reporter: morse, Assigned: kinmoz)

References

Details

Attachments

(1 file)

I run flawfinder (http://www.dwheeler.com/flawfinder) on Mozilla 1.0.1 branch.

flawfinder found 5 warnings in zlib code (1487-1491). Go through
that list and for each warning:

* If it is false positive, comment here why it is not an issue
* If it is a real issue, make patch for it here and let's get them checked in

In addition to checking the branch, also check the trunk.

1487) editor/libeditor/html/nsEditorTxnLog.cpp:391 [4] (format) printf: if 
format strings can be influenced by an attacker, they can be exploited. Use a 
constant for the format specification.

1488) editor/libeditor/html/nsEditorTxnLog.cpp:405 [4] (format) printf: if 
format strings can be influenced by an attacker, they can be exploited. Use a 
constant for the format specification.

1489) editor/libeditor/html/nsHTMLEditorLog.cpp:913 [4] (format) sprintf: 
Potential format string problem. Make format string constant.

1490) editor/libeditor/html/nsHTMLEditorLog.cpp:942 [2] (buffer) sprintf: does 
not check for buffer overflows. Use snprintf or vsnprintf. Risk is low because 
the source has a constant maximum length.

1491) editor/libeditor/html/nsHTMLEditorLog.cpp:944 [2] (buffer) sprintf: does 
not check for buffer overflows. Use snprintf or vsnprintf. Risk is low because 
the source has a constant maximum length.
Correction: above I said "zlib code".  I obviously cut-and-pasted too much.  
Meant to say "editor code".
Blocks: 148251
And three more flawfinder bugs in editor (4188-4290)

4288) editor/libeditor/html/nsEditorTxnLog.cpp:391 [4] (format) printf: if
format strings can be influenced by an attacker, they can be exploited. Use a
constant for the format specification.

4289) editor/libeditor/html/nsEditorTxnLog.cpp:405 [4] (format) printf: if
format strings can be influenced by an attacker, they can be exploited. Use a
constant for the format specification.

4290) editor/libeditor/html/nsHTMLEditorLog.cpp:913 [4] (format) sprintf:
Potential format string problem. Make format string constant.

Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.3alpha
I think this should take care of the warnings.
Comment on attachment 102847 [details] [diff] [review]
Patch Rev 1 (based on the TRUNK)

r=brade
Attachment #102847 - Flags: review+
Comment on attachment 102847 [details] [diff] [review]
Patch Rev 1 (based on the TRUNK)

sr=sfraser
Attachment #102847 - Flags: superreview+
Fix checked in to TRUNK:

  mozilla/editor/libeditor/html/nsEditorTxnLog.cpp  revision 1.14
  mozilla/editor/libeditor/html/nsEditorTxnLog.h    revision 1.9
  mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp revision 1.44
  mozilla/editor/libeditor/html/nsHTMLEditorLog.h   revision 1.30
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Keywords: nsbeta1+
rs vrfy.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.