1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Detect sscanf recovering_region input error

Missing check for sscanf found by static analyzer.
This commit is contained in:
Zdenek Kabelac 2011-09-06 18:24:27 +00:00
parent ebb39e1041
commit 054c6c890a
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.89 -
==================================
Detect sscanf recovering_region input error in cmirrord pull_state().
Fix error path bitmap leak in cmirrord import_checkpoint().
Log unlink() error in cmirrord remove_lockfile().
Remove incorrect requirement for -j or -m from lvchange error message.

View File

@ -1817,8 +1817,11 @@ int pull_state(const char *uuid, uint64_t luid,
}
if (!strncmp(which, "recovering_region", 17)) {
sscanf(buf, "%llu %u", (unsigned long long *)&lc->recovering_region,
&lc->recoverer);
if (sscanf(buf, "%llu %u", (unsigned long long *)&lc->recovering_region,
&lc->recoverer) != 2) {
LOG_ERROR("cannot parse recovering region from: %s", buf);
return -EINVAL;
}
LOG_SPRINT(lc, "CKPT INIT - SEQ#=X, UUID=%s, nodeid = X:: "
"recovering_region=%llu, recoverer=%u",
SHORT_UUID(lc->uuid),