Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit940e2b6

Browse files
committed
Renamed local var and initialized local vars. Undid accidental move.
1 parent86adee1 commit940e2b6

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

‎apache2/msc_reqbody.c‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -428,29 +428,29 @@ apr_status_t modsecurity_request_body_store(modsec_rec *msr,
428428
}
429429

430430
apr_status_tmodsecurity_request_body_to_stream(modsec_rec*msr,constchar*buffer,intbuflen,char**error_msg) {
431-
apr_size_tallocate;
432-
char*allocated;
431+
apr_size_tallocate_length=0;
432+
char*allocated=NULL;
433433

434434
if (msr->stream_input_data==NULL) {
435435
// Is the request body length is known beforehand? (requests that are not Transfer-Encoding: chunked)
436436
if (msr->request_content_length>0) {
437-
allocate=msr->request_content_length;
437+
allocate_length=msr->request_content_length;
438438
}
439439
else {
440440
// We don't know how this request is going to be, so hope for just buflen to begin with (requests that are Transfer-Encoding: chunked)
441-
allocate=buflen;
441+
allocate_length=buflen;
442442
}
443443

444-
allocated= (char*)calloc(allocate,sizeof(char));
444+
allocated= (char*)calloc(allocate_length,sizeof(char));
445445
if (allocated) {
446446
msr->stream_input_data=allocated;
447-
msr->stream_input_allocated_length=allocate;
447+
msr->stream_input_allocated_length=allocate_length;
448448
}
449449
else {
450450
*error_msg=apr_psprintf(
451451
msr->mp,
452452
"Unable to allocate memory to hold request body on stream. Asked for %"APR_SIZE_T_FMT" bytes.",
453-
allocate);
453+
allocate_length);
454454
return-1;
455455
}
456456
}
@@ -459,18 +459,18 @@ apr_status_t modsecurity_request_body_to_stream(modsec_rec *msr, const char *buf
459459
if ((msr->stream_input_length+buflen)>msr->stream_input_allocated_length) {
460460

461461
// If this becomes a hotspot again, consider increasing by some percent extra each time, for fewer reallocs
462-
allocate=msr->stream_input_length+buflen;
462+
allocate_length=msr->stream_input_length+buflen;
463463

464-
allocated= (char*)realloc(msr->stream_input_data,allocate);
464+
allocated= (char*)realloc(msr->stream_input_data,allocate_length);
465465
if (allocated) {
466466
msr->stream_input_data=allocated;
467-
msr->stream_input_allocated_length=allocate;
467+
msr->stream_input_allocated_length=allocate_length;
468468
}
469469
else {
470470
*error_msg=apr_psprintf(
471471
msr->mp,
472472
"Unable to reallocate memory to hold request body on stream. Asked for %"APR_SIZE_T_FMT" bytes.",
473-
allocate);
473+
allocate_length);
474474
free(msr->stream_input_data);
475475
return-1;
476476
}
@@ -891,15 +891,15 @@ apr_status_t modsecurity_request_body_clear(modsec_rec *msr, char **error_msg) {
891891

892892
if (msr->msc_reqbody_filename!=NULL) {
893893
if (keep_body) {
894+
/* Move request body (which is a file) to the storage area. */
895+
constchar*put_filename=NULL;
896+
constchar*put_basename=NULL;
897+
894898
if (strcmp(msr->txcfg->upload_dir,msr->txcfg->tmp_dir)==0) {
895899
msr_log(msr,4,"Not moving file to identical location.");
896900
gotonullify;
897901
}
898902

899-
/* Move request body (which is a file) to the storage area. */
900-
constchar*put_filename=NULL;
901-
constchar*put_basename=NULL;
902-
903903
/* Construct the new filename. */
904904
put_basename=file_basename(msr->msc_reqbody_mp,msr->msc_reqbody_filename);
905905
if (put_basename==NULL) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp