Browse Source

cli: check against multiple -f invocations to avoid leaks (patch by Stanislav Fomichev)

Felix Fietkau 12 years ago
parent
commit
a8c6241437
1 changed files with 5 additions and 0 deletions
  1. 5 0
      cli.c

+ 5 - 0
cli.c

@@ -633,6 +633,11 @@ int main(int argc, char **argv)
 				delimiter = optarg;
 				break;
 			case 'f':
+				if (input != stdin) {
+					perror("uci");
+					return 1;
+				}
+
 				input = fopen(optarg, "r");
 				if (!input) {
 					perror("uci");