Author: joes
Date: Mon Mar 14 10:48:08 2005
New Revision: 157446
URL: http://svn.apache.org/viewcvs?view=rev&rev=157446
Log:
ctx->body is NULL when there's no body to parse,
so we need to make sure that the body_status is APR_SUCCESS
to avoid a segfault.
Bug reported by Marcus Wichitill.
Modified:
httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c
Modified: httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c?view=diff&r1=157445&r2=157446
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c (original)
+++ httpd/apreq/branches/multi-env-unstable/module/apache2/handle.c Mon Mar 14
10:48:08 2005
@@ -184,7 +184,7 @@
/* riff on Duff's device */
apreq_filter_read(f, APREQ_DEFAULT_READ_BLOCK_SIZE);
- default:
+ case APR_SUCCESS:
val = apr_table_get(ctx->body, name);
if (val != NULL)
@@ -192,6 +192,15 @@
} while (ctx->status == APR_INCOMPLETE);
+ break;
+
+ default:
+
+ if (ctx->body != NULL) {
+ val = apr_table_get(ctx->body, name);
+ if (val != NULL)
+ return apreq_value_to_param(val);
+ }
}
return NULL;