Snort mailing list archives

Re: Qickfix to php issue: was: Fwd: php Bug #13419


From: chris koontz <ckoontz () yahoo com>
Date: Tue, 25 Sep 2001 09:03:18 -0700 (PDT)

actualy I discovered my code was broken (but it worked
enought to make it looked like it worked :) )
btw the latest CVS works fine...

thanks,
Chris
--- roman () danyliw com wrote:
Chris,

Props on the leg work you did to isolate this bug to
a version of PHP.
However, using your code with PHP 4.0.6 I received
incorrect
results.  For example, with an ID  of "#10-(1,1255),
I got back
sequence=10; sid=1; cid=1.

I commited some similar code which makes use of
explode().
Please test it on 4.0.6.7rc2 and let me know.

cheers,
Roman

Here is a quick fix to the php issue:
Replace the code that is inside function
"GetQueryResultID" in the file "acid_common.php"
with
the following:

$splitit=split("#",$submit);
$break1=split("-",$splitit[1]);
$seq = $break1[0];
$break2=split("\(",$break1[1]);
$break3=split("-",$break2[1]);
$break4=split("\)",$break3[0]);
$sid=$break3[0];
$cid=$break4[0];


#yes I know it's cheezy but I have to show it off
soon

--- chris koontz <ckoontz () yahoo com> wrote:
NOTE: the following function in acid_common.php
no
longer works with latest PHP... mfischer of the
php
team states this is not a php bug (his response
{and
the reason this function will no longer work) is
included below the function):

function GetQueryResultID($submit, &$seq, &$sid,
&$cid)
{
  strtok($submit, "#");
  $seq = strtok("-");
         strtok("(");
  $sid = strtok("-");
  $cid = strtok(")");
}

--- Bug Database <php-dev () lists php net> wrote:
Date: 24 Sep 2001 20:17:00 -0000
To: ckoontz () yahoo com
Subject: Bug #13419 Updated: strtok doesn't
properly
work with "#" as a token
From: Bug Database <php-dev () lists php net>

ID: 13419
Updated by: mfischer
Reported By: ckoontz () yahoo com
Old Status: Open
Status: Bogus
Bug Type: Strings related
Operating System: linux 2.4.9 (debian
unstable)
PHP Version: 4.0.6.7rc2
New Comment:

This is not a bug. This is the way strtok()
works.
Although PHP uses its own implementation,
strtok()
under C works the same and PHP mimics the C
version
(anything else would render this function
useless).

No bug, bogusifying.

If you need similar functionality take a look
at
explode()/split()

- Markus

Previous Comments:




------------------------------------------------------------------------

[2001-09-24 15:29:53] ckoontz () yahoo com

in the following code:
$string = "#This is an example string";
$tok1 = strtok($string,"#");

$tok1 should equal nothing.. however it equals
$string

This bug breaks ACID:
http://www.cert.org/kb/acid/

people on IRC have verified that this bug is
also
in
CVS as of this report





------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at
http://bugs.php.net/?id=13419&edit=2



=====



---------------ckoontz () yahoo com-------------------------
The above text is a natural product.  Slight
variations
in spelling and grammar enhance its individual
character
& beauty and in no way are to be considered
flaws or
defects.  



----------------------------------------------------------


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant
messaging with Yahoo! Messenger.
http://im.yahoo.com

_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or
unsubscribe:



https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:



http://www.geocrawler.com/redir-sf.php3?list=snort-users


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant
messaging with Yahoo! Messenger.
http://im.yahoo.com

_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or
unsubscribe:


https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:


http://www.geocrawler.com/redir-sf.php3?list=snort-users





---------------------------------------------
This message was sent using Voicenet WebMail.
      http://www.voicenet.com/webmail/



_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or
unsubscribe:

https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:

http://www.geocrawler.com/redir-sf.php3?list=snort-users


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com

_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


Current thread: