Bug #3794 SIGSEGV
Submitted: 17 May 2004 10:07 Modified: 7 Oct 2005 18:02
Reporter: Mirko Sacripanti Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:4 OS:Any (All)
Assigned to: CPU Architecture:Any

[17 May 2004 10:07] Mirko Sacripanti
Description:
uint STDCALL mysql_errno(MYSQL *mysql)
{
    if (mysql==NULL) return 0;
    else return mysql->net.last_errno;
}

How to repeat:
mysql_errno(NULL);

Suggested fix:
uint STDCALL mysql_errno(MYSQL *mysql)
{
    if (mysql==NULL) return 0;
    else return mysql->net.last_errno;
}
[7 Oct 2005 18:02] Hartmut Holzgraefe
none of the client API functions is prepared to work with uninitialized or invalid pointers,
it is your own responsibility to check that you got a valid MYSQL pointer back from
the init functions