ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccrtp-devel] bug in findusername (win32)


From: Steindl Christian
Subject: [Ccrtp-devel] bug in findusername (win32)
Date: Thu, 3 Apr 2003 14:05:49 +0200

an access violation occures in ccrtp/src/source.cpp(97):

static void
findusername(std::string &username)
{

        unsigned long len;
        GetUserName(NULL,&len);
        if ( len > 0 ) {
                char *n = new char[len];         
                GetUserName(n,&len);
                username = n;
                delete [] n;
        } else {
                username = "unidentified";
        }
}

I suggest following modification, since the second parameter of GetUserName
is in/out-parameter:

        unsigned long len = 0;
        if (GetUserName(NULL,&len) && ( len > 0 )) {

sincerely
-------------------------------------
Dipl.-Ing. Christian Steindl
ARC Seibersdorf research GmbH
2444 Seibersdorf
Telefon +43 (0) 50 550 2821
Fax     +43 (0) 50 550 2831
Email   address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]