bug in ccrtp-1.3.1 src/source.cpp line 79

Arjan Knepper <[email protected]>
Newsgroups gmane.comp.gnu.ccrtp.devel
Message-ID <[email protected]>
#ifndef WIN32
70: static void
71: findusername(std::string &username)
72: {
73:    // LOGNAME environment var has two advantages:
74:    // 1) avoids problems of getlogin(3) and cuserid(3)
75:    // 2) unlike getpwuid, takes into account user
76:    //    customization of the environment.
77:    // Try both LOGNAME and USER env. var.
78:    const char *user = Process::getEnv("LOGNAME");
79: //  if ( !strcmp(user,"") )
---------------------^^^^ !
79:     if ( ! user || !strcmp(user,"") )
80:        user = Process::getEnv("USER");
81:    if ( user )
82:        username = user;
83:    else
84:        username = "";
85: }

------------------------
ln 79 'user' might be 0 and should therefore be checked before using it.

Thanks,
Arjan Knepper
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.