Menu

#19 Check return codes everywhere

open
None
5
2007-03-31
2007-02-09
No

Some checks for return codes are missing.

Examples:
Would you like to add more error handling for return values from "malloc" like in the function "rfbSendSmallRectEncodingCoRRE" and from "fclose" in the function "rfbLoadConsoleFont"?
http://libvncserver.cvs.sourceforge.net/libvncserver/libvncserver/libvncserver/corre.c?revision=1.6&view=markup
http://libvncserver.cvs.sourceforge.net/libvncserver/libvncserver/libvncserver/font.c?revision=1.6&view=markup

Discussion

  • Johannes Schindelin

    • assigned_to: nobody --> dscho
     
  • Johannes Schindelin

    Logged In: YES
    user_id=27066
    Originator: NO

    Hi,

    thank you! Yes, for malloc I would like it! Although I am not so sure about fclose(). Should we really error out in that case?

    Ciao,
    Dscho

     
  • Markus Elfring

    Markus Elfring - 2007-02-09

    Logged In: YES
    user_id=572001
    Originator: YES

    Yes.

    Do you know more places with unchecked function calls in the source files?

     
  • Johannes Schindelin

    Logged In: YES
    user_id=27066
    Originator: NO

    Hi,

    no, not unless I would do a code review.

    Wanna help?

    Ciao,
    Dscho

     
  • Johannes Schindelin

    • status: open --> wont-fix
     
  • Johannes Schindelin

    Logged In: YES
    user_id=27066
    Originator: NO

    I am sorry. I do not have time right now to follow up on such unspecific
    issues. (If you create a patch, I will look at it, though.)

     
  • Markus Elfring

    Markus Elfring - 2007-03-31

    Logged In: YES
    user_id=572001
    Originator: YES

    What is "unspecific" about a recommended completition of the error handling?
    I will not develop a patch before the general acceptance and approach for the proposed updates is clear.

    Would you like to reduce the efforts for error code checking by a class hierarchy?
    http://dietmar-kuehl.de/mirror/c++-faq/exceptions.html#faq-17.1
    http://cexcept.sourceforge.net/

    Are you going to integrate your source files into a Subversion repository (at SourceForge)?

     
  • Markus Elfring

    Markus Elfring - 2007-03-31
    • status: wont-fix --> open
     
  • Johannes Schindelin

    Logged In: YES
    user_id=27066
    Originator: NO

    > What is "unspecific" about a recommended completition of the error
    > handling?

    It is not a patch. It is some handwaving "there could be somewhere some
    sort of return thing".

    There are clearly places, where error values are returned, and there are
    places that use these error values.

    > I will not develop a patch before the general acceptance and approach for
    > the proposed updates is clear.

    Guess what: I will not tell you beforehand if I take your patch or not,
    since I know nothing about the style, quality, and completeness of your
    code.

    > Would you like to reduce the efforts for error code checking by a class
    > hierarchy?
    > http://dietmar-kuehl.de/mirror/c++-faq/exceptions.html#faq-17.1
    > http://cexcept.sourceforge.net/

    I will not force acceptance of these things on users of LibVNCServer.
    IOW: No.

    > Are you going to integrate your source files into a Subversion repository
    > (at SourceForge)?

    The sources are tracked with Sourceforge's CVS service, although I use Git
    to manage it locally.

     
MongoDB Logo MongoDB