mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-18 18:22:07 +08:00
Null-terminate binary strings
See oss-fuzz/28779
This commit is contained in:
@@ -1001,8 +1001,9 @@ char *mdb_col_to_string(MdbHandle *mdb, void *buf, int start, int datatype, int
|
|||||||
if (size<0) {
|
if (size<0) {
|
||||||
text = g_strdup("");
|
text = g_strdup("");
|
||||||
} else {
|
} else {
|
||||||
text = g_malloc(size);
|
text = g_malloc(size+1);
|
||||||
memcpy(text, (char*)buf+start, size);
|
memcpy(text, (char*)buf+start, size);
|
||||||
|
text[size] = '\0';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MDB_TEXT:
|
case MDB_TEXT:
|
||||||
|
Reference in New Issue
Block a user