Skip to content

Conversation

@maobourne
Copy link

add check for unsafe strcpy()

add check for unsafe strcpy()
@drelaptop
Copy link
Contributor

please check code style, change TAB to 4 spaces

substitute tab with 4 spaces
size_t len = sizeof(char) * (strlen(first) + 3 + strlen(second));
char* test = (char*) malloc(len);
memset(test, 0,len);
if (test != NULL) //should check failure of malloc or it could be an undefined behaviour
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL -> nullptr

@minggo
Copy link
Contributor

minggo commented May 17, 2018

@drelaptop i think you can fix the tab issue based on this PR.

@drelaptop
Copy link
Contributor

yep, I can do it later 3.17 release.

@drelaptop
Copy link
Contributor

redo this change at #18885, for the author didn't response for a long time.

@drelaptop drelaptop closed this Jun 8, 2018
drelaptop added a commit that referenced this pull request Jun 8, 2018
* add check for unsafe strcpy()

add check for unsafe strcpy()

* complying with required coding style

substitute tab with 4 spaces

* NULL -> nullptr
stevetranby added a commit to stevetranby/cocos2d-x that referenced this pull request Sep 28, 2018
* commit 'b26e1bb08648c11a9482d0736a236aebc345008a': (27 commits)
  correct cocos2d#18768, add check for unsafe strcpy() (cocos2d#18885)
  Fix include guard in CCEventListenerMouse.h (cocos2d#18872)
  Fix for Label and UIRichEdit text trailing space trimming (cocos2d#18876)
  Fix iOS editbox EndAction wrong when single line mode. (UITextField) (cocos2d#18870)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#18868)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#18866)
  fix typos and grammar in comments (cocos2d#18853)
  Fix misleading comment text in CCMenu.h (cocos2d#18855)
  cc.PI2 was only present in html5 release, added it into JSB (cocos2d#18860)
  Avoid duplicate find action when founded. (cocos2d#18863)
  Fix ZipUtils include headers order (cocos2d#18857)
  fix cmake win32 macro definitions, and improve (cocos2d#18856)
  be safe to handle operator= (cocos2d#18850)
  fix cmake android prebuilt libcpufeatures path error (cocos2d#18847)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#18844)
  let app resource path visible when executing "cmake .." on win32 (cocos2d#18839)
  Add methods to change window icons on windows and linux (cocos2d#18833)
  Update CHANGELOG corrected little mistakes (cocos2d#18841)
  sync 3.17 to v3 (cocos2d#18837)
  add download multi task test case (cocos2d#18795)
  ...

# Conflicts:
#	cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java
#	cocos/ui/UIButton.cpp
#	tools/cocos2d-console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants