Menu

#149 strdup call with null pointer in freeglut_init.c

closed-fixed
nobody
None
5
2011-09-05
2011-05-28
Helixhorned
No

...on line 314. It can happen very well because getenv might come up empty. A possible patch is attached.

Discussion

  • Helixhorned

    Helixhorned - 2011-05-28
     
  • Eero Pajarre

    Eero Pajarre - 2011-06-08

    I must have goofed this one (my code), apparently it "works" on Windows/Microsoft libraries and thus went unnoticed.

    Instead of the patch provided by helixhorned I suggest that we replace strdup line with something like this:

    fgDisplay.DisplayName=displayName ? strdup(displayName) : 0 ;

    The rest of the code expects null pointer when DisplayName has not been specified.

    I will send a patch to the mailing list

     
  • John F. Fay

    John F. Fay - 2011-09-05

    Fixed in change set 926

     
  • John F. Fay

    John F. Fay - 2011-09-05
    • status: open --> closed-fixed
     

Log in to post a comment.