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

Fix Invalid Pointer Usage in esp_rmaker_report_info (MEGH-6380) #342

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

treister
Copy link
Contributor

@treister treister commented Feb 11, 2025

Pull Request Summary: Fix Invalid Pointer Usage in esp_rmaker_report_info Issue

Compilation failed due to incorrect pointer usage in snprintf and json_gen_obj_set_* calls. The function incorrectly passed &key_name (a char (*)[3] type) instead of key_name (a char *), causing type mismatch errors. Fix

Corrected snprintf usage: Passed key_name instead of &key_name.
Fixed json_gen_obj_set_* calls: Removed unnecessary address-of operator (&key_name).
Ensured correct string formatting: snprintf now correctly assigns key_name values without an explicit null termination.

Impact

Resolves compilation errors for ESP32-C3 builds.
Maintains intended functionality with proper string handling.
No functional changes, just type correctness fixes.

This fix ensures successful builds and prevents runtime issues due to incorrect pointer usage

Description

Related

Testing


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Pull Request Summary: Fix Invalid Pointer Usage in esp_rmaker_report_info
Issue

Compilation failed due to incorrect pointer usage in snprintf and json_gen_obj_set_* calls. The function incorrectly passed &key_name (a char (*)[3] type) instead of key_name (a char *), causing type mismatch errors.
Fix

    Corrected snprintf usage: Passed key_name instead of &key_name.
    Fixed json_gen_obj_set_* calls: Removed unnecessary address-of operator (&key_name).
    Ensured correct string formatting: snprintf now correctly assigns key_name values without an explicit null termination.

Impact

    Resolves compilation errors for ESP32-C3 builds.
    Maintains intended functionality with proper string handling.
    No functional changes, just type correctness fixes.

This fix ensures successful builds and prevents runtime issues due to incorrect pointer usage
@CLAassistant
Copy link

CLAassistant commented Feb 11, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title Fix Invalid Pointer Usage in esp_rmaker_report_info Fix Invalid Pointer Usage in esp_rmaker_report_info (MEGH-6380) Feb 11, 2025
@espressif-bot espressif-bot merged commit f5fbf58 into espressif:master Feb 12, 2025
1 check passed
@treister treister deleted the patch-1 branch February 12, 2025 15:54
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