Parcourir la source

apt-helper: Check that we can open stdout

Gbp-Dch: ignore
Julian Andres Klode il y a 10 ans
Parent
commit
cb7fce2449
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      cmdline/apt-helper.cc

+ 2 - 1
cmdline/apt-helper.cc

@@ -114,7 +114,8 @@ static bool DoCatFile(CommandLine &CmdL)				/*{{{*/
    char buf[4096];
    unsigned long long read;
 
-   out.OpenDescriptor(STDOUT_FILENO, FileFd::WriteOnly);
+   if (out.OpenDescriptor(STDOUT_FILENO, FileFd::WriteOnly) == false)
+      return false;
 
    if (CmdL.FileSize() <= 1)
       return _error->Error("Must specify at least one file name");