celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pepijn Noltes (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CELIX-32) serviceTracker_create method creates wrong filter
Date Wed, 07 Mar 2012 13:28:59 GMT

    [ https://issues.apache.org/jira/browse/CELIX-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224322#comment-13224322

Pepijn Noltes commented on CELIX-32:

Note that the serviceTracker_create methods calls the serviceTracker_createWithFilter method.
The latter should also allocate memory in which case the filter string will be allocated twice.
This is not optimal and maybe a third (static) method should be created (serviceTracker_createWithFilter2)
which a extra argument if memory should be allocated for the provided filter.
> serviceTracker_create method creates wrong filter
> -------------------------------------------------
>                 Key: CELIX-32
>                 URL: https://issues.apache.org/jira/browse/CELIX-32
>             Project: Celix
>          Issue Type: Bug
>            Reporter: Pepijn Noltes
> The serviceTracker_create method uses strcpy and strcat to create a filter from a provided
service name. The algorithm contains a bug a writes 1 byte to much to the allocated memory.
> Solution: instead of strcat/strcpy use apr_pstrcat:
> char *filter  = apr_pstrcat(pool, "(", OBJECTCLASS, "=", service, ")", NULL);

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message