Perl: added more checks for 'body' variable
This commit is contained in:
@@ -896,6 +896,11 @@ nxt_perl_psgi_result_body_ref(PerlInterpreter *my_perl, SV *sv_body,
|
|||||||
u_char vbuf[8192];
|
u_char vbuf[8192];
|
||||||
|
|
||||||
io = GvIO(SvRV(sv_body));
|
io = GvIO(SvRV(sv_body));
|
||||||
|
|
||||||
|
if (io == NULL) {
|
||||||
|
return NXT_OK;
|
||||||
|
}
|
||||||
|
|
||||||
fp = IoIFP(io);
|
fp = IoIFP(io);
|
||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
@@ -1015,7 +1020,7 @@ nxt_perl_psgi_result_array(PerlInterpreter *my_perl, SV *result,
|
|||||||
|
|
||||||
sv_temp = av_fetch(array, 2, 0);
|
sv_temp = av_fetch(array, 2, 0);
|
||||||
|
|
||||||
if (nxt_slow_path(sv_temp == NULL)) {
|
if (nxt_slow_path(sv_temp == NULL || SvROK(*sv_temp) == FALSE)) {
|
||||||
nxt_log_error(NXT_LOG_ERR, task->log,
|
nxt_log_error(NXT_LOG_ERR, task->log,
|
||||||
"PSGI: Failed to get body from Perl ARRAY variable");
|
"PSGI: Failed to get body from Perl ARRAY variable");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user