id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 109,counted_base::add_ref not overflow-safe,nobody,nobody,"{{{ Greetings, In order to track the number of shared_ptrs that refer to a certain object, the function counted_base::add_ref calls the overloaded operator ++() of the corresponding count_type member data. That in turn does increment a variable of built-in type (volatile long), but it does not check wether the result fits into the variable or not. A possible solution: a) in atomic_count::operator ++(): if(value_ != std::numeric_limits::max()) ...call atomic increment else throw ... some exception b) at least mention this somewhere in the documentation. Although this is certainly a situation unlikely to be ever appearing in practice, it might happen and can be the source for lots of trouble. best regards, Thomas Mang }}}",Bugs,closed,,smart_ptr,None,,Rejected,,