svn commit: r344248 - head/stand/libsa

Toomas Soome tsoome at FreeBSD.org
Mon Feb 18 08:26:19 UTC 2019


Author: tsoome
Date: Mon Feb 18 08:26:18 2019
New Revision: 344248
URL: https://svnweb.freebsd.org/changeset/base/344248

Log:
  cd9660: dirmatch fails to unmatch when name is prefix for directory record
  
  Loader does fail to properly match the file name in directory record and
  does open file based on prefix match.
  
  For fix, we check the name lengths first.
  
  Reviewed by:	allanjude
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D19213

Modified:
  head/stand/libsa/cd9660.c

Modified: head/stand/libsa/cd9660.c
==============================================================================
--- head/stand/libsa/cd9660.c	Mon Feb 18 04:44:52 2019	(r344247)
+++ head/stand/libsa/cd9660.c	Mon Feb 18 08:26:18 2019	(r344248)
@@ -241,6 +241,10 @@ dirmatch(struct open_file *f, const char *path, struct
 		icase = 1;
 	} else
 		icase = 0;
+
+	if (strlen(path) != len)
+		return (0);
+
 	for (i = len; --i >= 0; path++, cp++) {
 		if (!*path || *path == '/')
 			break;


More information about the svn-src-all mailing list