Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do_httpx3: Use of uninitialized value $headers in split ... #490

Open
EnDe opened this issue Nov 13, 2024 · 0 comments
Open

do_httpx3: Use of uninitialized value $headers in split ... #490

EnDe opened this issue Nov 13, 2024 · 0 comments

Comments

@EnDe
Copy link

EnDe commented Nov 13, 2024

This perl warning happens when the server returns an empty response.
I'd suggest following patch:

index 3838b59..a25944b 100644
--- a/SSLeay.pm
+++ b/SSLeay.pm-1.94-do_httpx3-patch
@@ -1800,6 +1800,7 @@ sub do_httpx3 {
     return (undef, "HTTP/1.0 900 NET OR SSL ERROR$CRLF$CRLF$errs") if $errs;
 
     $http = '' if !defined $http;
+    $http = "\n" if '' eq $http; # to avoid "Use of uninitialized value $headers in split ..." below if httpx_cat() returned empty content
     ($headers, $page) = split /\s?\n\s?\n/, $http, 2;
     warn "headers >$headers< page >>$page<< http >>>$http<<<" if $trace>1;
     ($response, $headers) = split /\s?\n/, $headers, 2;

To be improved in many ways, as this change may have side effects when headers are used elsewhere; I didn't search at other places in the code ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant