Author: rjung
Date: Sun Sep 2 13:02:30 2007
New Revision: 572134
URL: http://svn.apache.org/viewvc?rev=572134&view=rev
Log:
Need to cast void* map value to char* before dereferencing.
Modified:
tomcat/connectors/trunk/jk/native/common/jk_map.c
Modified: tomcat/connectors/trunk/jk/native/common/jk_map.c
URL:
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.c?rev=572134&r1=572133&r2=572134&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.c Sun Sep 2 13:02:30 2007
@@ -756,7 +756,8 @@
"Checking for references with prefix %s with%s wildcard
(recursion %d)",
prefix, wildcard? "" : "out", depth);
for (i = 0; i < m->size; i++) {
- if (m->values[i] && *(m->values[i]) &&
+ char *v = (char *)m->values[i];
+ if (v && *v &&
!strncmp(m->names[i], prefix, prelen)) {
size_t remain = strlen(m->names[i]) - prelen;
if ((remain == JK_MAP_REFERENCE_SZ ) || (wildcard &&
remain > JK_MAP_REFERENCE_SZ)) {
@@ -764,7 +765,7 @@
if (!strncmp(m->names[i] + remain, JK_MAP_REFERENCE,
JK_MAP_REFERENCE_SZ)) {
char *from = jk_pool_alloc(&m->p,
(sizeof(char) *
- (strlen(m->values[i]) +
2)));
+ (strlen(v) + 2)));
char *to = jk_pool_alloc(&m->p,
(sizeof(char) *
(remain + 2)));
@@ -774,14 +775,14 @@
rc = JK_FALSE;
break;
}
- strcpy(from, m->values[i]);
- *(from+strlen(m->values[i])) = '.';
- *(from+strlen(m->values[i])+1) = '\0';
+ strcpy(from, v);
+ *(from+strlen(v)) = '.';
+ *(from+strlen(v)+1) = '\0';
strncpy(to, m->names[i], remain);
*(to+remain) = '.';
*(to+remain+1) = '\0';
- rc = jk_map_resolve_references(m, m->values[i], 0,
depth+1, l);
+ rc = jk_map_resolve_references(m, v, 0, depth+1,
l);
if (rc == JK_FALSE) {
break;
}
@@ -793,7 +794,7 @@
if (rc == JK_FALSE) {
break;
}
- *(m->values[i]) = '\0';
+ *v = '\0';
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]