Skip to content

Check the comments array boundry. #993

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

Merged
merged 2 commits into from
Sep 16, 2019

Conversation

dota17
Copy link
Member

@dota17 dota17 commented Jul 23, 2019

Currently, a Segmentation fault (core dumped) caused by the wrong use of setComment method:

root.setComment(commentPtr, Json::numberOfCommentPlacement);

we should check the comment array boundry before we assign comment value to Array to avoid this seg fault.

@dota17
Copy link
Member Author

dota17 commented Jul 23, 2019

The Travis CI failed in Linux xenial gcc cmake coverage:

CMake Error at include/cmake_install.cmake:41 (file):
  file INSTALL cannot find
  "/home/travis/build/open-source-parsers/jsoncpp/build-cmake_Debug_shared_g++_make/include/json/version.h".
Call Stack (most recent call first):
  cmake_install.cmake:70 (include)

@baylesj
Copy link
Contributor

baylesj commented Jul 31, 2019

Fixed the travis build issue, can you try force pushing to this branch to restart the travis checks?

@dota17
Copy link
Member Author

dota17 commented Sep 12, 2019

@baylesj should we throw a error or exception when users write code like:

root.setComment(commentPtr, Json::numberOfCommentPlacement);

In this PR, I do nothing in this case, just ignore the boundry action.

Copy link
Contributor

@baylesj baylesj left a comment

Choose a reason for hiding this comment

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

numberOfCommentPlacement is an awkward name I would be in favor of changing. This patch is good, though.

@baylesj baylesj merged commit d622250 into open-source-parsers:master Sep 16, 2019
@dota17 dota17 deleted the commentArray branch September 17, 2019 03:34
dawesc pushed a commit to EFTlab/jsoncpp that referenced this pull request Sep 25, 2019
* check the comments array boundry

* remove empty line
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.

2 participants