From a8c62414373177d8dda554adde97312f50bb8468 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 21 Oct 2011 15:15:24 +0200 Subject: [PATCH] cli: check against multiple -f invocations to avoid leaks (patch by Stanislav Fomichev) --- cli.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cli.c b/cli.c index 54f9484..196a83e 100644 --- a/cli.c +++ b/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"); -- 2.25.1