Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Feb 2007 16:51:00 GMT
From:      Todd Miller <millert@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 114875 for review
Message-ID:  <200702231651.l1NGp0mZ041641@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114875

Change 114875 by millert@millert_macbook on 2007/02/23 16:50:50

	Use strdupa() now that we have it in libsecompat

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#6 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#6 (text+ko) ====

@@ -177,16 +177,14 @@
 				"Warning! %s refers to a symbolic link, not following last component.\n",
 				filename);
 		char *p = NULL, *file_sep;
-		char *tmp_path;
+		char *tmp_path = strdupa(filename);
 		size_t len = 0;
 
-		tmp_path = alloca(strlen(filename) + 1);
 		if (!tmp_path) {
 			fprintf(stderr, "strdupa on %s failed:  %s\n", filename,
 				strerror(errno));
 			return 1;
 		}
-		strcpy(tmp_path, filename);
 		file_sep = strrchr(tmp_path, '/');
 		if (file_sep == tmp_path) {
 			file_sep++;



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