Skip to content

Commit d82e8b6

Browse files
committed
xml info - terminate memcpy result with '\0'. Fixes #127
1 parent 4710977 commit d82e8b6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lsl_streaminfo_c.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ LIBLSL_C_API char *lsl_get_xml(lsl_streaminfo info) {
6060
return nullptr;
6161
}
6262
memcpy(result, tmp.c_str(), tmp.size());
63+
result[tmp.size()] = '\0';
6364
return result;
6465
} catch (std::exception &e) {
6566
LOG_F(WARNING, "Unexpected error in lsl_get_xml: %s", e.what());

0 commit comments

Comments
 (0)