Skip to content
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

Uninitialized scalar variable &temp_data #68591

Closed
wants to merge 1 commit into from
Closed

Uninitialized scalar variable &temp_data #68591

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 6, 2024

zcbor_map_start_encodefunction is using Uninitialized variable &temp_data

Fixes #68636

Copy link

github-actions bot commented Feb 6, 2024

Hello @Nu1l-ptr, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@ghost ghost requested a review from nordicjm February 6, 2024 07:49
@ghost ghost requested a review from nordicjm February 6, 2024 07:57
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

The commits need to be squashed into one, if you do a git rebase then mark the other 2 as fixup. Also the commit title and message should be formatted as per https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-message-guidelines

@ghost ghost requested a review from nordicjm February 6, 2024 08:27
@ghost
Copy link
Author

ghost commented Feb 6, 2024

I think i need to use memset(temp_data, 0, sizeof(temp_data)) instead of temp_data = NULL because it is giving incompatible pointer to integer conversion assigning to 'uint8_t' error.

@de-nordic
Copy link
Collaborator

I think i need to use memset(temp_data, 0, sizeof(temp_data)) instead of temp_data = NULL because it is giving incompatible pointer to integer conversion assigning to 'uint8_t' error.

The temp_data ain't pointer.

Copy link
Collaborator

@de-nordic de-nordic left a comment

Choose a reason for hiding this comment

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

Click in the comment #68591 (comment):
image

@ghost ghost requested a review from de-nordic February 6, 2024 09:10
@@ -266,7 +266,8 @@ static size_t upload_message_header_size(struct img_gr_upload *upload_state)
} else {
map_count = 10;
}
temp_data = NULL;

memset(temp_data, 0, sizeof(temp_data));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't really know what you are doing? Remove this and change line 258 to:

	uint8_t temp_data = 0;

Copy link
Author

@ghost ghost Feb 6, 2024

Choose a reason for hiding this comment

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

sorry, I am not too used to git.

@nordicjm
Copy link
Collaborator

nordicjm commented Feb 6, 2024

The commits need to be squashed

@zephyrbot zephyrbot added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label Feb 6, 2024
Copy link
Collaborator

@de-nordic de-nordic left a comment

Choose a reason for hiding this comment

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

Sorry, need to introduce yourself when doing changes:
https://docs.zephyrproject.org/latest/contribute/guidelines.html#signed-off-by
image

Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Title needs to be more defined e.g. mgmt: mcumgr: grp: img_mgmt_client: <blah> and missing commit message

@carlescufi
Copy link
Member

@Nu1l-ptr we need this fix for the upcoming 3.6.0 release. Please fix the issues or we will need to open a parallel Pull Request fixing this. Thanks in advance!

Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request.

@henrikbrixandersen
Copy link
Member

@Nu1l-ptr we need this fix for the upcoming 3.6.0 release. Please fix the issues or we will need to open a parallel Pull Request fixing this. Thanks in advance!

Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request.

Superseded by #68974

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcumgr Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
5 participants