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

Fixed unsafe string dup behaviour. #153

Merged
merged 3 commits into from
Mar 31, 2023
Merged

Fixed unsafe string dup behaviour. #153

merged 3 commits into from
Mar 31, 2023

Conversation

xinyi-xs
Copy link
Contributor

No description provided.

@JaylinYu
Copy link
Member

@alvin1221 plz fix related unsafe strcmp

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 85.71% and project coverage change: +0.03 🎉

Comparison is base (3248d1c) 61.42% compared to head (4c6a5a7) 61.46%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #153      +/-   ##
==========================================
+ Coverage   61.42%   61.46%   +0.03%     
==========================================
  Files          99       99              
  Lines       26480    26484       +4     
==========================================
+ Hits        16266    16278      +12     
+ Misses      10214    10206       -8     
Impacted Files Coverage Δ
src/supplemental/mqtt/mqtt_public.c 15.68% <0.00%> (ø)
src/supplemental/mqtt/mqtt_codec.c 42.42% <100.00%> (+0.02%) ⬆️
src/supplemental/mqtt/mqtt_msg.c 28.37% <100.00%> (+0.16%) ⬆️

... and 20 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/supplemental/mqtt/mqtt_msg.c Outdated Show resolved Hide resolved
Copy link
Member

@JaylinYu JaylinYu left a comment

Choose a reason for hiding this comment

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

alvin thank lee

@JaylinYu JaylinYu merged commit a00b2a5 into main Mar 31, 2023
@JaylinYu JaylinYu deleted the lee/dev1 branch March 31, 2023 04:29
{
topic_qos[index].topic.buf = (uint8_t *) nni_strdup(topic_name);
topic_qos[index].topic.length = (uint32_t) strlen(topic_name);
topic_qos[index].topic.buf = (uint8_t *) nni_alloc(len * sizeof(uint8_t));
Copy link
Member

Choose a reason for hiding this comment

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

Why not just use function strndup()?

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.

4 participants