2011/10/31 <[email protected]>:
> Author: mturk
> Date: Mon Oct 31 12:44:39 2011
> New Revision: 1195434
>
> URL: http://svn.apache.org/viewvc?rev=1195434&view=rev
> Log:
> Fix weird jk_pool_strdup declaration and add jk_pool_strcat function
>
> Modified:
> tomcat/jk/trunk/native/common/jk_pool.c
> tomcat/jk/trunk/native/common/jk_pool.h
>
> +char *jk_pool_strcat(jk_pool_t *p, const char *s, const char *a)
+ if (a)
+ size += strlen(a);
Then strcat(rc, a); is always called, without checking whether a is NULL.
+ rc = jk_pool_alloc(p, size);
+ if (rc) {
+ if (rc != s)
+ strcpy(rc, s);
rc can be equal to s ?
> --- tomcat/jk/trunk/native/common/jk_pool.h (original)
> +++ tomcat/jk/trunk/native/common/jk_pool.h Mon Oct 31 12:44:39 2011
> @@ -118,7 +118,9 @@ void *jk_pool_alloc(jk_pool_t *p, size_t
> void *jk_pool_realloc(jk_pool_t *p,
> size_t sz, const void *old, size_t old_sz);
>
> -void *jk_pool_strdup(jk_pool_t *p, const char *s);
> +char *jk_pool_strdup(jk_pool_t *p, const char *s);
> +
> +char *jk_pool_strdcat(jk_pool_t *p, const char *s, const char *a);
There is a typo in *.h above:
s/strdcat/strcat/
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]