xenbus_dev: add missing error check to watch handling
So far only the watch path was checked to be zero terminated, while the watch token was merely assumed to be. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
Родитель
e4de866a83
Коммит
a43a5ccdfa
|
@ -369,6 +369,10 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
token++;
|
token++;
|
||||||
|
if (memchr(token, 0, u->u.msg.len - (token - path)) == NULL) {
|
||||||
|
rc = -EILSEQ;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (msg_type == XS_WATCH) {
|
if (msg_type == XS_WATCH) {
|
||||||
watch = alloc_watch_adapter(path, token);
|
watch = alloc_watch_adapter(path, token);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче