MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0023842Community[OCCT] OCCT:Visualizationpublic2013-03-20 12:272013-04-29 15:24
ReporterPawel 
Assigned Tokgv 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformAOSLOS VersionL
Product Version[OCCT] 6.4.0 
Target Version[OCCT] 6.6.0Fixed in Version[OCCT] 6.6.0 
Summary0023842: Undefined behavior: Variable 'thePsFont' is used as parameter and destination in s[n]printf()
DescriptionIn OpenGl_Text.cxx, line 96:

sprintf (thePsFont, "%s%s", thePsFont, TheItalic[aFontId]);

cppcheck message:
"The variable 'thePsFont' is used both as a parameter and as destination in s[n]printf(). The origin and destination buffers overlap. Quote from glibc (C-library) documentation (http://www.gnu.org/software/libc/manual/html_mono/libc.html#Formatted-Output-Functions [^]): "If copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined.""
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships

-  Notes
(0023812)
abv (manager)
2013-03-20 12:38

The offending code has been introduced in 0023457
(0023813)
kgv (developer)
2013-03-20 13:18
edited on: 2013-03-20 13:18

> The offending code has been introduced in 0023457
No it didn't.

(0023817)
kgv (developer)
2013-03-20 15:07

Patch is ready for review in CR23842 branch.
(0023826)
san (developer)
2013-03-20 17:32

Branch CR23842 reviewed without remarks, ready for testing.
(0023839)
mkv (tester)
2013-03-21 18:24

Dear BugMaster,

Branch CR23842 (and products from GIT master) was compiled on Linux and Windows platforms and tested without rebase.
SHA-1: 6903904a719f26c7f17d93bfd0a31a1208d68f98

Number of compiler warnings:

occt component :
Linux: 3 (3 on master)
Windows: 11 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 50 (50 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 243477684 / 241671364
Total CPU difference: 17405.350000000162 / 14694.200000000103

Testing on Windows:
Total MEMORY difference: 352774980 / 354810080
Total CPU difference: 21124.578125 / 22916.015625

There are not serious differences in images found by testdiff.

- Related Changesets
occt: master 8b224a09
Timestamp: 2013-03-20 11:06:32
Author: kgv
Details ] Diff ]
0023842: Undefined behavior: Variable 'thePsFont' is used as parameter and destination in s[n]printf()
mod - src/OpenGl/OpenGl_Text.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2013-03-20 12:27 Pawel New Issue
2013-03-20 12:27 Pawel Assigned To => bugmaster
2013-03-20 12:38 abv Note Added: 0023812
2013-03-20 12:38 abv Assigned To bugmaster => kgv
2013-03-20 12:38 abv Status new => assigned
2013-03-20 12:38 abv Relationship added child of 0023457
2013-03-20 12:39 abv Target Version 6.7.0 => 6.6.0
2013-03-20 13:18 kgv Note Added: 0023813
2013-03-20 13:18 kgv Product Version 6.5.4 => 6.4.0
2013-03-20 13:18 kgv Note Edited: 0023813 View Revisions
2013-03-20 15:07 kgv Note Added: 0023817
2013-03-20 15:07 kgv Assigned To kgv => san
2013-03-20 15:07 kgv Status assigned => resolved
2013-03-20 17:32 san Note Added: 0023826
2013-03-20 17:32 san Assigned To san => bugmaster
2013-03-20 17:32 san Status resolved => reviewed
2013-03-20 18:21 mkv Assigned To bugmaster => mkv
2013-03-21 08:29 kgv Relationship deleted child of 0023457
2013-03-21 18:24 mkv Note Added: 0023839
2013-03-21 18:24 mkv Test case number => Not needed
2013-03-21 18:24 mkv Assigned To mkv => bugmaster
2013-03-21 18:24 mkv Status reviewed => tested
2013-03-25 18:39 kgv Changeset attached => occt master 8b224a09
2013-03-25 18:39 kgv Assigned To bugmaster => kgv
2013-03-25 18:39 kgv Status tested => verified
2013-03-25 18:39 kgv Resolution open => fixed
2013-04-23 13:35 user533 Status verified => closed
2013-04-29 15:24 user533 Fixed in Version => 6.6.0


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker