PERFORCE change 178281 for review

Jonathan Anderson jona at FreeBSD.org
Sat May 15 03:20:23 UTC 2010


http://p4web.freebsd.org/@@178281?ac=10

Change 178281 by jona at 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
 		{


More information about the p4-projects mailing list