arduino / arduino/ArduinoCore-API

String == String does not work with embedded NUL characters

Open
#112 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
306
Forks
150
PR merge metrics
No merged PRs in 30d

Description

https://github.com/arduino/ArduinoCore-API/blob/7f8de5869ee3de7a915bf1db64313c08595b3ac3/api/String.cpp#L445 and https://github.com/arduino/ArduinoCore-API/blob/7f8de5869ee3de7a915bf1db64313c08595b3ac3/api/String.cpp#L445 should use ``memcmp()`` to make sure that a String object can be compared to another String object that has embedded ``NUL`` characters

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in api/String.cpp at the comparison code around line 445 and inspect how String objects are compared when embedded NUL characters are present. Update the comparison as described to handle those characters, then verify that String-to-String comparisons work correctly for embedded NUL values.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.