We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3af3a1a commit 3195d23Copy full SHA for 3195d23
src/FirebaseArduino.cpp
@@ -183,8 +183,9 @@ FirebaseObject FirebaseArduino::readEvent() {
183
// required to have a copy of the string but use a char[] format which is
184
// the only supported format for JsonObject#set (it does not like the std::string of the test env)
185
char *cstr = new char[type.length() + 1];
186
- strcpy(cstr, type.c_str());
+ strncpy(cstr, type.c_str(), type.length() + 1);
187
obj.getJsonVariant().as<JsonObject&>().set("type", cstr);
188
+ delete[] cstr;
189
return obj;
190
}
191
0 commit comments