← Commit list

a9e341a469

Viktor Szakats
Viktor Szakats
2026-03-19
SUCCESS Duration: 287s

Subject

optiontable: replace stdin with filename arg, harden `open()` call

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/CMakeLists.txt+1 -1
@@ -379,7 +379,7 @@ endif()
if(PERL_EXECUTABLE)
add_custom_target(curl-optiontable
COMMENT "Generating lib/easyoptions.c" VERBATIM USES_TERMINAL
- COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/optiontable.pl" < "${PROJECT_SOURCE_DIR}/include/curl/curl.h"
+ COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/optiontable.pl" "${PROJECT_SOURCE_DIR}/include/curl/curl.h"
> "${PROJECT_SOURCE_DIR}/lib/easyoptions.c"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/optiontable.pl" "${PROJECT_SOURCE_DIR}/include/curl/curl.h"
)
lib/Makefile.am+1 -1
@@ -178,7 +178,7 @@ tidy:
@CLANG_TIDY@ --config-file=$(top_srcdir)/.clang-tidy.yml $(TIDYFLAGS) $(CURL_CLANG_TIDYFLAGS) $$_csources -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H $(_tidy_cflags))
optiontable:
- @PERL@ $(srcdir)/optiontable.pl < $(top_srcdir)/include/curl/curl.h > $(srcdir)/easyoptions.c
+ @PERL@ $(srcdir)/optiontable.pl $(top_srcdir)/include/curl/curl.h > $(srcdir)/easyoptions.c
if HAVE_WINDRES
.rc.lo:
lib/optiontable.pl+4 -1
@@ -79,7 +79,9 @@ sub add {
}
my $fl;
-while(<STDIN>) {
+my $file = shift @ARGV;
+open(CURL_H, '<', $file) or die;
+while(<CURL_H>) {
my $l = $_;
if($fl) {
# continued deprecation
@@ -121,6 +123,7 @@ while(<STDIN>) {
}
}
}
+close(CURL_H);
for my $name (sort @names) {
my $oname = $name;
tests/test1276.pl+1 -1
@@ -34,7 +34,7 @@ sub showline {
my $root = $ARGV[0] || '..';
-open(my $fh, "-|", "perl $root/lib/optiontable.pl < $root/include/curl/curl.h");
+open(my $fh, "-|", 'perl', "$root/lib/optiontable.pl", "$root/include/curl/curl.h");
binmode $fh;
my @gen=<$fh>;
close($fh);