felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Herko ter Horst (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FELIX-4304) DependencyManager ComponentImpl should not assume all service properties are stored in a Hashtable
Date Wed, 06 Nov 2013 12:32:20 GMT

     [ https://issues.apache.org/jira/browse/FELIX-4304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Herko ter Horst updated FELIX-4304:
-----------------------------------

    Attachment: ComponentImpl.java.patch

> DependencyManager ComponentImpl should not assume all service properties are stored in
a Hashtable
> --------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-4304
>                 URL: https://issues.apache.org/jira/browse/FELIX-4304
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-3.1.0
>            Reporter: Herko ter Horst
>         Attachments: ComponentImpl.java.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In org.apache.felix.dm.impl.ComponentImpl.getServiceProperties() a copy of the internal
field m_serviceProperties is created by casting to Hashtable and calling clone(). However,
as clients are allowed to call setServiceProperties(Dictionary properties) which assigns the
parameter value to the field, it is very possible for m_serviceProperties to contain some
other Dictionary implementation.
> The attached patch doesn't solves this problem in getServiceProperties() by making a
copy by enumerating over all keys and putting them in a newly created Hashtable.
> Alternatively (or in addition), setProperties() could be changed to ensure the parameter
value isn't directly assigned to the field.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message