Fix crash with very long (>128K) attribute values

This commit is contained in:
Eric Fischer
2017-05-18 14:48:18 -07:00
parent d0980e29d0
commit eb8ab1dd58
5 changed files with 29 additions and 2 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ int memfile_write(struct memfile *file, void *s, long long len) {
return -1;
}
file->len += INCREMENT;
file->len += (len + INCREMENT + 1) / INCREMENT * INCREMENT;
if (ftruncate(file->fd, file->len) != 0) {
return -1;