Merge PR #53053 into main

* refs/pull/53053/head:
	libcephsqlite: fill 0s in unread portion of buffer

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Patrick Donnelly 2023-08-23 13:57:25 -04:00
commit 4a6f6ed0f3
No known key found for this signature in database
GPG Key ID: FA47FD0B0367D313

View File

@ -353,7 +353,7 @@ static int Read(sqlite3_file *file, void *buf, int len, sqlite_int64 off)
auto end = ceph::coarse_mono_clock::now();
getdata(f->vfs).logger->tinc(P_OPF_READ, end-start);
if (rc < len) {
memset(buf, 0, len-rc);
memset((unsigned char*)buf+rc, 0, len-rc);
return SQLITE_IOERR_SHORT_READ;
} else {
return SQLITE_OK;