Various error handling issues with signGP.c

Bug #669275 reported by Loïc Minier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
x-loader (Ubuntu)
Fix Released
Undecided
Loïc Minier
x-loader-omap4 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi

There are various issues with the signGP.c in x-loader (added by debian/patches/add_signGP.diff):
- it's built with "$(CC) -o signGP signGP.c" which is not policy compliant as it doesn't turn on warnings, or debug symbols, or optimizations -- this would probably have catched the last error listed below
- it returns zero exit status upon error:
+ // Open the input file.
+ ifile = fopen(ifname, "rb");
+ if (ifile == NULL) {
+ printf("Cannot open %s\n", ifname);
+ exit(0);
+ }
- it doesn't return any specific exit status in main():
+main(int argc, char *argv[])
+{
[...]
+ fclose(ifile);
+ fclose(ofile);
+}

So signGP should be fixed to:
- be built with -Wall -g -O2
- return 1 for every error condition
- return 0 explicitly at end of build

Cheers,

Tags: armel
tags: added: armel
Changed in x-loader (Ubuntu):
assignee: nobody → Ricardo Salveti (rsalveti)
Loïc Minier (lool)
Changed in x-loader (Ubuntu):
assignee: Ricardo Salveti (rsalveti) → Loïc Minier (lool)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package x-loader - 1.4.4git20100713-1ubuntu5

---------------
x-loader (1.4.4git20100713-1ubuntu5) natty; urgency=low

  * Various error handling issues with signGP.c; LP: #669275.
    - debian/signGP: return 0 at end of main(), and return 1 instead of
      exit(0) on failure conditions.
    - rules: pass CFLAGS to CC when building signGP.
 -- Loic Minier <email address hidden> Sun, 05 Dec 2010 03:12:34 +0100

Changed in x-loader (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package x-loader-omap4 - L24.9git20100901-0ubuntu5

---------------
x-loader-omap4 (L24.9git20100901-0ubuntu5) natty; urgency=low

  * New patch, 10_misc-signgp-fixes, various error handling issues with
    signGP.c; return 0 at end of main(), and return 1 instead of exit(0) on
    failure conditions; LP: #669275.
 -- Loic Minier <email address hidden> Tue, 07 Dec 2010 11:00:36 +0100

Changed in x-loader-omap4 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.