This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258463 - MacOSX and CLang: sprintf does not have security hint
Summary: MacOSX and CLang: sprintf does not have security hint
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: danilasergeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-21 11:50 UTC by soldatov
Modified: 2016-08-02 01:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2016-03-21 11:50:19 UTC
C Code:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv) {
    char s[10];
    sprintf(s, "%s", "abcd");
    return (EXIT_SUCCESS);
}

Automatic test expects "sprintf is a insecure function" hint. CLang+MacOSX doesn't display hint. I think because "sprintf" is a macro.
Comment 1 soldatov 2016-03-21 11:59:07 UTC
Same problem with "snprintf"

P.S. This option switched off by default. But sign doesn't appear if I switched on this option.
Comment 2 danilasergeyev 2016-07-26 10:57:09 UTC
What version of OS X was used for tests?
Seems to work fine on the latest 10.11 El Capitan
Comment 3 soldatov 2016-07-26 11:12:21 UTC
I use 10.11 too.
Any step are important in my scenario.
1) C only
2) CLang only
Comment 4 danilasergeyev 2016-07-26 12:48:53 UTC
fixed in change set:
http://hg.netbeans.org/cnd-main/rev/5e8a58724d58
Comment 5 Quality Engineering 2016-08-02 01:57:57 UTC
Integrated into 'main-silver', will be available in build *201608020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5e8a58724d58
User: Danila Sergeyev <danilasergeyev@netbeans.org>
Log: fix bug #258463 MacOSX and CLang: sprintf does not have security hint