mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:44:12 +08:00
mdbx-tools: fix Coverity warning (paranoia).
Change-Id: I3ff33a9eb2c58fe601566fd4101f9c95d76d29de
This commit is contained in:
parent
ac6d423451
commit
7617cce0c6
@ -431,7 +431,13 @@ int main(int argc, char *argv[]) {
|
||||
goto env_close;
|
||||
}
|
||||
|
||||
kbuf.iov_len = mdbx_env_get_maxkeysize(env) * 2 + 2;
|
||||
kbuf.iov_len = mdbx_env_get_maxkeysize(env);
|
||||
if (kbuf.iov_len >= SIZE_MAX / 4) {
|
||||
fprintf(stderr, "mdbx_env_get_maxkeysize failed, returns %zu\n",
|
||||
kbuf.iov_len);
|
||||
goto env_close;
|
||||
}
|
||||
kbuf.iov_len = (kbuf.iov_len + 1) * 2;
|
||||
kbuf.iov_base = malloc(kbuf.iov_len * 2);
|
||||
k0buf.iov_len = kbuf.iov_len;
|
||||
k0buf.iov_base = (char *)kbuf.iov_base + kbuf.iov_len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user