mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
dmeventd: check for msg.data nonnull
Ensure we will not use msg.data as NULL for strchr.
This commit is contained in:
parent
ba3cee3630
commit
45f396f2a0
@ -815,13 +815,13 @@ int dm_event_get_version(struct dm_event_fifos *fifos, int *version) {
|
||||
p = msg.data;
|
||||
*version = 0;
|
||||
|
||||
p = strchr(p, ' '); /* Message ID */
|
||||
if (!p) return 0;
|
||||
p = strchr(p + 1, ' '); /* HELLO */
|
||||
if (!p) return 0;
|
||||
p = strchr(p + 1, ' '); /* HELLO, once more */
|
||||
if (p)
|
||||
if (!p || !(p = strchr(p, ' '))) /* Message ID */
|
||||
return 0;
|
||||
if (!(p = strchr(p + 1, ' '))) /* HELLO */
|
||||
return 0;
|
||||
if ((p = strchr(p + 1, ' '))) /* HELLO, once more */
|
||||
*version = atoi(p);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user