Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 May 2010 03:20:22 GMT
From:      Jonathan Anderson <jona@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 178281 for review
Message-ID:  <201005150320.o4F3KMrk016317@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@178281?ac=10

Change 178281 by jona@jona-belle-freebsd8 on 2010/05/15 03:20:09

	Only do relative naming if the retrieved filename has length > 0

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/lib/libcapsicum/libcapsicum_fdlist.c#15 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/lib/libcapsicum/libcapsicum_fdlist.c#15 (text+ko) ====

@@ -31,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/trustedbsd/capabilities/src/lib/libcapsicum/libcapsicum_fdlist.c#14 $
+ * $P4: //depot/projects/trustedbsd/capabilities/src/lib/libcapsicum/libcapsicum_fdlist.c#15 $
  */
 
 #include <sys/mman.h>
@@ -433,6 +433,14 @@
 			return (-1);
 
 		len = strlen(dirname);
+
+		/* if there is no filename, we can't do relative naming */
+		if (len == 0)
+		{
+			fd = -1;
+			continue;
+		}
+
 		if (strncmp(dirname, filename, len)) fd = -1;
 		else
 		{



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