Menu

#1 gethostname() with no check for zero-len

open
nobody
None
5
2003-02-05
2002-07-30
Anonymous
No

I am porting OpenSLP to VxWorks and found that the
slpd daemon will crash if the host name for the platform
was not set.

Under VxWorks the platform host name can be NULL,
and a call to gethostname() will return a status of OK in
that case but the strlen() of the resultant host name will
be zero. The slpd code checks the status of the
gethostname() call, but does not also check the length
to make sure it's not zero. Later on when this null-string
is referenced, the slpd daemon will terminate.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Glenn Highland
    Sr. Software Engineer
    CNT
    glenn_highland@cnt.com

     
  • Matt Peterson

    Matt Peterson - 2003-02-05
    • labels: 102524 -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.