Commit 237ce2e6 authored by Sjoerd Simons's avatar Sjoerd Simons Committed by Richard Weinberger
Browse files

um: vector: Avoid NULL ptr deference if transport is unset



When the transport option of a vec isn't set strncmp ends up being
called on a NULL pointer. Better not do that.

Signed-off-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 33631793
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -197,6 +197,9 @@ static int get_transport_options(struct arglist *def)
	long parsed;
	int result = 0;

	if (transport == NULL)
		return -EINVAL;

	if (vector != NULL) {
		if (kstrtoul(vector, 10, &parsed) == 0) {
			if (parsed == 0) {