mazu-editor icon indicating copy to clipboard operation
mazu-editor copied to clipboard

Perform static analysis for potential weakness

Open dlintw opened this issue 6 years ago • 1 comments

I've tried to use cpplint(just copy the cpplint.py and it often workable).

The CPPLINT.cfg which fit for current coding style as

filter=-legal/copyright,-whitespace/comments,-readability/multiline_comment,-whitespace/braces,-readability/braces
linelength=132

The output of cpplint.py me.c

me.c:514:  Almost always, snprintf is better than strcpy  [runtime/printf] [4]
me.c:778:  Consider using localtime_r(...) instead of localtime(...) for improved thread safety.  [runtime/threadsafe_fn] [2]

In formal secure coding, strcpy is not suggest to use anymore.

dlintw avatar Apr 24 '19 02:04 dlintw

cppcheck is another tool to be investigated.

jserv avatar Apr 24 '19 13:04 jserv