bugGNU recutils - Bugs: bug #30621, The code is not checking the...

 
 

bug #30621: The code is not checking the return values of all system calls

Submitted by:  Jose E. Marchesi <jemarch>
Submitted on:  Sun 01 Aug 2010 08:10:04 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: Jose E. Marchesi <jemarch>
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 07 Mar 2012 02:20:53 PM UTC, comment #6:

I suggest to avoid unchecked function calls.
Would you like to add more error handling for return values from "printf" like in the function "rec_sex_ast_print_node" and from "strdup" in the function "rec_write_comment"?

http://git.savannah.gnu.org/cgit/recutils.git/tree/src/rec-sex-ast.c?id=e24c2e65200f5f46f1d5b8a7a3b377c6e953204e#n249
http://git.savannah.gnu.org/cgit/recutils.git/tree/src/rec-writer.c?id=32e6feb78680846858fa971e51bb5385d69e3104#n114

Markus Elfring <elfring>
Sat 06 Nov 2010 10:50:44 AM UTC, comment #5:

Inserted in TODO.

Jose E. Marchesi <jemarch>
Project AdministratorIn charge of this item.
Mon 23 Aug 2010 03:59:04 PM UTC, comment #4:

The code of the utilities are now using xmalloc and xstrdup.

Jose E. Marchesi <jemarch>
Project AdministratorIn charge of this item.
Thu 05 Aug 2010 07:04:54 PM UTC, comment #3:

Hi Karl.

That looks like a good idea. I just imported the module
and used it, and created some useful common routines in
utils/recutl.c.

Thanks!

Jose E. Marchesi <jemarch>
Project AdministratorIn charge of this item.
Mon 02 Aug 2010 09:29:04 PM UTC, comment #2:

also, you should use the closeout gnulib module so that commands like recwhatever >/dev/full exit appropriately. See GNU hello for an example if you need it :).

Karl Berry <karl>
Mon 02 Aug 2010 07:49:06 PM UTC, comment #1:

The 'malloc' cases are done, but it would be better to
use the gnulib xmalloc module in the utilities.

Jose E. Marchesi <jemarch>
Project AdministratorIn charge of this item.
Sun 01 Aug 2010 08:10:04 PM UTC, original submission:

There are some unchecked malloc() calls in both the library
and the utilities. Any system call shall have its return
value checked.

Jose E. Marchesi <jemarch>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by elfring (Posted a comment)
  • -unavailable- added by karl (Posted a comment)
  • -unavailable- added by jemarch (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 02 Aug 2010 07:49:15 PM UTCjemarchAssigned toNone=>jemarch

    Back to the top


    Powered by Savane 3.1-cleanup1