Issue 77485 - dbmgr.cxx: zero terminated varargs function throws SIGSEGV
Summary: dbmgr.cxx: zero terminated varargs function throws SIGSEGV
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: 680m211
Hardware: PC (x86_64) All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: kendy
QA Contact: issues@sw
URL:
Keywords:
: 71750 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-05-18 16:40 UTC by jnavrati
Modified: 2013-08-07 14:42 UTC (History)
3 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch replace zero by NULL (927 bytes, text/plain)
2007-05-18 16:42 UTC, jnavrati
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description jnavrati 2007-05-18 16:40:43 UTC
Different promotion for 0 (zero) and NULL at the end of varargs function. Zero
throws SIGSEGV signal because it isn't considered to pointed to NULL.
Comment 1 jnavrati 2007-05-18 16:42:35 UTC
Created attachment 45226 [details]
patch replace zero by NULL
Comment 2 caolanm 2007-05-18 16:55:32 UTC
Yeah, because a 0 is just an int and isn't promoted to a 64bit pointer on x86_64
in this case because the method signature has an ... eclipse and so when the
loop to look for a 0 pointer is run there is no long on the stack, just an int. ugh!

cmc->kendy, pjanik: if either of you wants to snarf this go ahead, otherwise
I'll pick it up next week. We may have more of this type of monstrosity floating
around.
Comment 3 caolanm 2007-05-21 14:38:43 UTC
better do this myself, I have a workspace open. I'll first have a scan for
problems in other uses of these ellipsed methods.
Comment 4 caolanm 2007-05-22 10:18:30 UTC
Search for other by temporarily renaming the method, built OOo, checked the
missing ones. 

Only sw has some of the Execute( ..., 0), everyplace else has Execute( ..., 0L)
or Execute(..., NULL) so just a few places in sw to be modified.

Done in cmcfixes34.
Comment 5 caolanm 2007-05-22 14:57:35 UTC
reassign for a quick look-see.

cmc->kendy: Can I get you to verify this. Looks straightforward to me, make a
few places in sw the same as everywhere else.
Comment 6 kendy 2007-05-22 15:34:45 UTC
caolan: My personal preference would be to use (void *) NULL, but 0L does as 
good job I guess, so - verified ;-)  Thank you!
Comment 7 caolanm 2007-06-06 08:41:26 UTC
oh, for reference, I went for 0L not (void*)0 or static_cast<void*>(0) because
the root of the hierarchy of this is sfx2 and 0L is used consistently there and
throughout the majority of OOo, so aligned the offending code with the most
consistent style.
Comment 8 kendy 2007-06-06 10:33:43 UTC
OK, everything is perfect then, thank you once more!
Comment 9 jnavrati 2007-06-13 11:24:11 UTC
*** Issue 71750 has been marked as a duplicate of this issue. ***
Comment 10 thorsten.ziehm 2009-07-20 15:20:04 UTC
This issue is closed automatically and wasn't rechecked in a current version of
OOo. The fixed issue should be integrated in OOo since more than half a year. If
you think this issue isn't fixed in a current version (OOo 3.1), please reopen
it and change the field 'Target Milestone' accordingly.

If you want to download a current version of OOo =>
http://download.openoffice.org/index.html
If you want to know more about the handling of fixed/verified issues =>
http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues