Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 May 2009 16:59:51 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192021 - head/sys/geom/concat
Message-ID:  <200905121659.n4CGxrMM027967@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue May 12 16:59:50 2009
New Revision: 192021
URL: http://svn.freebsd.org/changeset/base/192021

Log:
  Check return value of gctl_get_asciiparam().
  
  Found with:	Coverity Prevent(tm)
  CID:		1118

Modified:
  head/sys/geom/concat/g_concat.c

Modified: head/sys/geom/concat/g_concat.c
==============================================================================
--- head/sys/geom/concat/g_concat.c	Tue May 12 16:39:43 2009	(r192020)
+++ head/sys/geom/concat/g_concat.c	Tue May 12 16:59:50 2009	(r192021)
@@ -753,6 +753,10 @@ g_concat_ctl_create(struct gctl_req *req
 	for (attached = 0, no = 1; no < *nargs; no++) {
 		snprintf(param, sizeof(param), "arg%u", no);
 		name = gctl_get_asciiparam(req, param);
+		if (name == NULL) {
+			gctl_error(req, "No 'arg%d' argument.", no);
+			return;
+		}
 		if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
 			name += strlen("/dev/");
 		pp = g_provider_by_name(name);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905121659.n4CGxrMM027967>