View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029252 | Open CASCADE | OCCT:Coding | public | 2017-10-21 21:07 | 2018-06-29 21:19 |
Reporter | kgv | Assigned To | bugmaster | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu 17.10 | ||
Product Version | 7.2.0 | ||||
Target Version | 7.3.0 | Fixed in Version | 7.3.0 | ||
Summary | 0029252: Coding rules - eliminate GCC compiler warnings -Wformat-overflow | ||||
Description | The following GCC 7.2.0 compiler warnings should be eliminated./occt.git/src/OSD/OSD_DirectoryIterator.cxx: In member function ‘void OSD_DirectoryIterator::Next()’: /occt.git/src/OSD/OSD_DirectoryIterator.cxx:100:6: warning: ‘%s’ directive writing up to 255 bytes into a region of size 254 [-Wformat-overflow=] void OSD_DirectoryIterator::Next(){ ^~~~~~~~~~~~~~~~~~~~~ /occt.git/src/OSD/OSD_DirectoryIterator.cxx:123:13: note: ‘sprintf’ output 2 or more bytes (assuming 257) into a destination of size 255 sprintf(full_name,"%s/%s",myPlace.ToCString(), ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ((struct dirent *)myEntry)->d_name); // LD debug ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /occt.git/src/OSD/OSD_FileIterator.cxx: In member function ‘void OSD_FileIterator::Next()’: /occt.git/src/OSD/OSD_FileIterator.cxx:176:6: warning: ‘%s’ directive writing up to 255 bytes into a region of size 254 [-Wformat-overflow=] void OSD_FileIterator::Next(){ ^~~~~~~~~~~~~~~~ /occt.git/src/OSD/OSD_FileIterator.cxx:199:13: note: ‘sprintf’ output 2 or more bytes (assuming 257) into a destination of size 255 sprintf(full_name,"%s/%s",myPlace.ToCString(), ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ((struct dirent *)myEntry)->d_name); // LD debug ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ||=== Build finished: 0 error(s), 2 warning(s) (17 minute(s), 37 second(s)) ===| | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
Branch CR29252 has been created by kgv. SHA-1: 5f2ddbf140ebec9e6836b287c6a3617fbdd7a8c3 Detailed log of new commits: Author: kgv Date: Sat Oct 21 21:17:14 2017 +0300 0029252: Coding rules - eliminate GCC compiler warnings -Wformat-overflow OSD_DirectoryIterator and OSD_FileIterator now uses TCollection_AsciiString instead of unsafe sprintf. |
|
Patch is ready for review. |
|
Reviewed, please test. A side note is: function readdir used in the affected code is not reentrant; thread-safe version exist, called readdir_r. |
|
> A side note is: function readdir used in the affected code is not reentrant; > thread-safe version exist, called readdir_r. readdir_r has bad design and is deprecated within glibc: http://man7.org/linux/man-pages/man3/readdir_r.3.html |
|
Combination - OCCT branch : CR29252 SHA-1: 5f2ddbf140ebec9e6836b287c6a3617fbdd7a8c3 Products branch : master was compiled on Linux, MacOS and Windows platforms and tested on optimize mode on jenkins-test-10 and jenkins-tets-08. Number of compiler warnings: No new/fixed warnings Regressions/Differences/Improvements: No regressions/differences CPU differences: No differences that require special attention Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR29252 has been deleted by kgv. SHA-1: 5f2ddbf140ebec9e6836b287c6a3617fbdd7a8c3 |
occt: master 65ada1f1 2017-10-21 18:17:14 Committer: bugmaster Details Diff |
0029252: Coding rules - eliminate GCC compiler warnings -Wformat-overflow OSD_DirectoryIterator and OSD_FileIterator now uses TCollection_AsciiString instead of unsafe sprintf. |
Affected Issues 0029252 |
|
mod - src/OSD/OSD_DirectoryIterator.cxx | Diff File | ||
mod - src/OSD/OSD_FileIterator.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-10-21 21:07 | kgv | New Issue | |
2017-10-21 21:07 | kgv | Assigned To | => kgv |
2017-10-21 21:08 | kgv | OS | Ubuntu 17.04 => Ubuntu 17.10 |
2017-10-21 21:10 | kgv | Description Updated | |
2017-10-21 21:17 | git | Note Added: 0071677 | |
2017-10-21 21:19 | kgv | Note Added: 0071678 | |
2017-10-21 21:19 | kgv | Assigned To | kgv => abv |
2017-10-21 21:19 | kgv | Status | new => resolved |
2017-10-21 22:01 |
|
Note Added: 0071680 | |
2017-10-21 22:01 |
|
Assigned To | abv => bugmaster |
2017-10-21 22:01 |
|
Status | resolved => reviewed |
2017-10-21 22:45 | kgv | Note Added: 0071682 | |
2017-10-24 16:09 | bugmaster | Note Added: 0071748 | |
2017-10-24 16:09 | bugmaster | Status | reviewed => tested |
2017-10-24 18:50 | bugmaster | Test case number | => Not required |
2017-10-27 09:54 | bugmaster | Changeset attached | => occt master 65ada1f1 |
2017-10-27 09:54 | bugmaster | Status | tested => verified |
2017-10-27 09:54 | bugmaster | Resolution | open => fixed |
2017-11-08 18:24 | git | Note Added: 0072080 | |
2018-02-20 12:58 |
|
Target Version | 7.4.0 => 7.3.0 |
2018-06-02 14:24 | kgv | Relationship added | related to 0029834 |
2018-06-29 21:13 |
|
Fixed in Version | => 7.3.0 |
2018-06-29 21:19 |
|
Status | verified => closed |