Bug #9461 Updated: imap_open crash when connecting to nntp with username and password
| From: | chagenbu@php.net | Date: | Wed, 02 May 2001 20:49:11 +0000 |
| Subject: | Bug #9461 Updated: imap_open crash when connecting to nntp with username and password | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-53455@lists.php.net to get a copy of this message | ||
ID: 9461
Updated by: chagenbu
Reported By: bo@erichsen.com
Status: Open
Bug Type: IMAP related
PHP Version: 4.0 Latest CVS (26/02/2001)
Assigned To:
Comments:
From: James Treleaven <jametrel@enoreo.on.ca>
Like the author of bug #9461, I also tracked the problem down to mm_login() in ext/imap/php_imap.c
[that is where my stack was getting stomped]. I replaced the later two calls to strncpy() in the
function, with calls to strcpy(), and now I can use the function to login to news servers with no
problem!
The code in mm_login() looks correct to me - but I cannot believe that there is a bug in
Linux's libc.a:strncpy(). I have a web based gateway up and running with hundreds of
user's using my modified imap_open() to successfully connect to nntp with their usernames and
passwords (we always require authentication). My modification seems to be a good workaround - but I
don't know why.
Previous Comments:
---------------------------------------------------------------------------
[2001-02-26 08:36:22] bo@erichsen.com
function that causes crash
<?php>
imap_open('{newsserver/nntp}'.'test.test','username','password')
|| die("can't connect: ".imap_last_error());
</php>
backtrace from gdb ( i know it says nothing but i did as described in the backtrace faq.)
#0 0x0 in ?? ()
I have a problem with imap_open:
I can do imap_open on nntp server that has no authentication. But when i try on
a nntpserver that requires a password.. php dumps core (signal 11 gdb backtrace
is #0 0x0 in ?? ()) ( i executed the cgi version of php to be sure that apache
has nothing to do with it.)
i tested c-client with the mtest program and it worked perfectly.
I've tried to compile php4 with -enable-debug but i'm not so experienced with
gdb so when i load the core-file i still get no symbols or references to the
instruction that causes the problem.
it should be simple to test:
try to connect to a nntp server without username and password
try to connect to a nntp server that requires username and password
i have looked through the c-client code and the php4 extension and i could
imagine the problem might be in mm_login but i'm not certain.
the server is running:
php4.0.5-dev latest cvs
linux 2.2.12-20smp
imap (imap-2001.BETA.SNAP-0102201858) also tried (imap-4.7c)
All help is appreciated and if anybody wants more information or maybe a test
nntp account i can provide that (just send me a mail bo@erichsen.com).
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9461&edit=2