[tpop3d-discuss]sigsegv error, patch attached

Chris Lightfoot chris at ex-parrot.com
Fri, 12 Mar 2004 12:57:44 +0000


On Fri, Mar 12, 2004 at 03:55:29AM -0800, Jeff Davis wrote:
> In version 1.5.3 I was getting a memory error when using the maildir
> mbox type.
> 
> In summary, the function maildir_new would assign to the boolean var
> "locked" similar to the following:
> 
> if( this_condition && !(locked = maildir_lock(M->name))) {
>     ...
> }
> 
> And the problem was, locked was not initialized to false. So, if
> this_condition failed, the RHS would not be evaluated, and thus locked
> would not be assigned, and then generally have a true value.
> 
> Later, of course the value of locked is tested, and succeeds, and then
> attempts to maildir_unlock(M->name), which causes the segfault, since
> maildir_unlock assumes M->name is locked (which it isn't, it's just
> fooled by the uninitialized variable).


thanks for this. I think it's fixed in CVS, in fact, but I
haven't had time to do a release lately.


-- 
``It just seems to me that you are wilfully entering an arse-kicking
  contest with a monstrous entity that has sixteen legs and no arse....''
  (seen on the internet)