ACE_Refcounted_Auto_Ptr_Rep pointer assignment to "NULL" or "0" #1847
Replies: 1 comment 1 reply
-
I'm not familiar with this class at all, so I might be wrong about this, but here are the places I could find that use ACE_TAO/ACE/ace/Refcounted_Auto_Ptr.inl Lines 143 to 144 in 1522d0f ACE_TAO/ACE/ace/Refcounted_Auto_Ptr.inl Lines 178 to 179 in 1522d0f In these two uses it sets to null after ACE_TAO/ACE/ace/Refcounted_Auto_Ptr.inl Lines 156 to 160 in 1522d0f ACE_TAO/ACE/ace/Refcounted_Auto_Ptr.inl Lines 171 to 174 in 1522d0f In these two cases it's replacing the pointer so it doesn't matter what it does with the old pointer value. Assuming it's not used again. ACE_TAO/ACE/ace/Refcounted_Auto_Ptr.cpp Lines 11 to 15 in 1522d0f Here the object is going away so it doesn't really matter either. So it looks like it's not nulling the value just because it doesn't always strictly have to. I do admit it would be the safe thing to do though. Do you see a use-after-free issue with this or is this just a question? |
Beta Was this translation helpful? Give feedback.
-
ACE version 6.3.4
Hi,
I am new to ACE,
In the following code block, why "rep" is not assigned with "NULL" or "0" after deleting it.
is it bug, that it is not assigned with "NULL" or "0" ?
Beta Was this translation helpful? Give feedback.
All reactions