]> granicus.if.org Git - curl/commitdiff
mk-ca-bundle.pl: Check curl's exit code after certdata download
authorJay Satiro <raysatiro@yahoo.com>
Fri, 16 Jun 2017 05:58:23 +0000 (01:58 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 16 Jun 2017 05:58:23 +0000 (01:58 -0400)
- No longer allow partial downloads of certdata.

Prior to this change partial downloads were (erroneously?) allowed since
only the server code was checked to be 200.

Bug: https://github.com/curl/curl/pull/1577
Reported-by: Matteo B.
lib/mk-ca-bundle.pl

index 9574f1dbf95bddf5378163cdd254dcfb3d1f7d6f..cc36c7680c8ac1bb3c7666550a65260957d998fe 100755 (executable)
@@ -310,7 +310,7 @@ if(!$opt_n) {
         my $proto = !$opt_k ? "--proto =https" : "";
         my $quiet = $opt_q ? "-s" : "";
         my @out = `curl -w %{response_code} $proto $quiet -o "$txt" "$url"`;
-        if(@out && $out[0] == 200) {
+        if(!$? && @out && $out[0] == 200) {
           $fetched = 1;
           report "Downloaded $txt";
         }