-
Notifications
You must be signed in to change notification settings - Fork 7.1k
add check for unsafe strcpy() #18768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add check for unsafe strcpy()
Contributor
|
please check code style, change |
substitute tab with 4 spaces
minggo
reviewed
May 17, 2018
| 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 |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL -> nullptr
Contributor
|
@drelaptop i think you can fix the tab issue based on this PR. |
Contributor
|
yep, I can do it later 3.17 release. |
Contributor
|
redo this change at #18885, for the author didn't response for a long time. |
drelaptop
added a commit
that referenced
this pull request
Jun 8, 2018
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add check for unsafe strcpy()