Skip to content

Should WString use memcpy not strcpy #213

Open
@petejan

Description

@petejan

In WString.cpp (this also applies to avr core)

https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/WString.cpp#L179 and
https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/WString.cpp#L271

strcpy is used, where are length is passed to the copy and concat operation, whereas memcpy should be used so the char* can contain the 0 character.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions