[asterisk-bugs] [Asterisk 0014289]: utils/refcounter segfaults due to reference of count1_obj when its NULL

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Jan 21 11:21:22 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14289 
====================================================================== 
Reported By:                jamesgolovich
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   14289
Category:                   Utilities/General
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 169487 
Request Review:              
====================================================================== 
Date Submitted:             2009-01-20 14:46 CST
Last Modified:              2009-01-21 11:21 CST
====================================================================== 
Summary:                    utils/refcounter segfaults due to reference of
count1_obj when its NULL
Description: 
I'm not sure if this happens to everyone or just something unique in my
situation.  First time I've played with refcounter.

Line 164 prints an error if count1_obj doesn't exist but then tries to
reference count1_obj->addr which is a guaranteed segfault.

Not sure what the appropriate action is here, in my copy I just removed
the reference so the error message is just printed.

-                               printf("BAD: object %x appears without
previous allocation marker!\n", count1_obj->addr);
+                               printf("BAD: object appears without
previous allocation marker!\n");

====================================================================== 

---------------------------------------------------------------------- 
 (0098325) svnbot (reporter) - 2009-01-21 11:21
 http://bugs.digium.com/view.php?id=14289#c98325 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 169673

U   trunk/utils/refcounter.c

------------------------------------------------------------------------
r169673 | murf | 2009-01-21 11:21:21 -0600 (Wed, 21 Jan 2009) | 14 lines

This patch corrects a segfault reported in 14289,
due to a null ptr being refd.

Yes, seanbright is right in the bug comments, that is the fix.
Sorry for this oversight; I guess my personal
usage didn't have this happen!

murf

(closes issue http://bugs.digium.com/view.php?id=14289)
Reported by: jamesgolovich



------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=169673 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-21 11:21 svnbot         Checkin                                      
2009-01-21 11:21 svnbot         Note Added: 0098325                          
======================================================================




More information about the asterisk-bugs mailing list