From: Felix Fietkau Date: Fri, 21 Oct 2011 13:15:24 +0000 (+0200) Subject: cli: check against multiple -f invocations to avoid leaks (patch by Stanislav Fomichev) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a8c62414373177d8dda554adde97312f50bb8468;p=oweals%2Fuci.git cli: check against multiple -f invocations to avoid leaks (patch by Stanislav Fomichev) --- 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");