Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 3195d23

Browse files
committed
Integrated feedback
1 parent 3af3a1a commit 3195d23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/FirebaseArduino.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ FirebaseObject FirebaseArduino::readEvent() {
183183
// required to have a copy of the string but use a char[] format which is
184184
// the only supported format for JsonObject#set (it does not like the std::string of the test env)
185185
char *cstr = new char[type.length() + 1];
186-
strcpy(cstr, type.c_str());
186+
strncpy(cstr, type.c_str(), type.length() + 1);
187187
obj.getJsonVariant().as<JsonObject&>().set("type", cstr);
188+
delete[] cstr;
188189
return obj;
189190
}
190191

0 commit comments

Comments
 (0)