Commits

Stephen Smalley committed 3c98ad9

Return an error if no path is supplied to the label backends.

Change-Id: I5af4591d733429b3348bbe87d6711200645af27b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>

Comments (0)

Files changed (2)

src/label_android_property.c

 			break;
 		}
 
+	/* No path supplied. */
+	if (!path) {
+		errno = ENOENT;
+		return -1;
+	}
+
 	/* Open the specification file. */
 	if ((fp = fopen(path, "r")) == NULL)
 		return -1;
 			break;
 		}
 
+	/* No path supplied. */
+	if (!path) {
+		errno = ENOENT;
+		return -1;
+	}
+
 	/* Open the specification file. */
 	if ((fp = fopen(path, "r")) == NULL)
 		return -1;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.