After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 311072 - Patch to fix crashes in expense conduit
Patch to fix crashes in expense conduit
Status: RESOLVED FIXED
Product: gnome-pilot
Classification: Other
Component: conduit system
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-pilot Maintainers
gnome-pilot Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-07-21 02:32 UTC by Mark Adams
Modified: 2006-06-19 00:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix two bugs in expense conduit (1.53 KB, patch)
2005-07-21 02:34 UTC, Mark Adams
needs-work Details | Review
Changelog entry (391 bytes, patch)
2005-07-21 02:34 UTC, Mark Adams
needs-work Details | Review

Description Mark Adams 2005-07-21 02:32:26 UTC
Version details: gnome-pilot-conduits-2.0.13-1
Distribution/Version: Fedora Core 4

While working on getting gnome-pilot-conduits in FC4 updated to work with the
shipped pilot-link (see bug #274032), I ran into a crash in the expense conduit.

It turns out that there are two bugs here.

1) the check for the directory being set isn't sufficient, as the dialog box
sets an empty string, but we only check for NULL

2) if an error occurs (such as while calling mkdir), we try to close the array
of opened file descriptors... except they've not yet been opened or even initialized

The attached patch fixes both of those bugs. A changelog entry is also attached.
Comment 1 Mark Adams 2005-07-21 02:34:08 UTC
Created attachment 49492 [details] [review]
Fix two bugs in expense conduit
Comment 2 Mark Adams 2005-07-21 02:34:45 UTC
Created attachment 49493 [details] [review]
Changelog entry
Comment 3 JP Rosevear 2005-08-10 13:24:56 UTC
Couple things, to replace the magic number, I'd prefer a #define.  Not only
should the empty string be tested, but the conduit should also create a default
directory in configuration like memo_file does.
Comment 4 Matt Davey 2006-06-19 00:04:34 UTC
The magic number 17 dates from revision 1.1.
The number is based on the number of categories, which as far as I can
tell is, and has always been, 16.  The extra one was being used as an
'Archived' class, but from looking at the code it seems it was never
implemented as a feature, so I've dropped it.  pi-appinfo.h doesn't
supply a #define for the number of categories, so I've just commented
where the magic number comes from.

Yes, the capplet should be doing more work checking arguments, creating
the directory, etc. etc., but we'd still have to check args at runtime
in case someone was upgrading or had edited the config file directly...
So I've committed the patch to prevent the worst crasher effects.

I have now tested that backup, expense, memo_file, sendmail,
file, and mal conduits all seem to work under 0.12.0.