spamass-milt-list
[Top][All Lists]
Advanced

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

"bob" coredump patch


From: Valentin Chopov
Subject: "bob" coredump patch
Date: Wed, 16 Jul 2003 14:19:47 -0400 (EDT)

Hello,

Here is a patch to the latest CVS spamass-milter.cpp
I found that in some cases when there is an empty body.
"bob" becomes equal to "string::npos" (or -1) and
string body=assassin->d().substr(bob, string::npos);
coredumps the spamass-milter.

Thanks,
Val


*** spamass-milter.cpp  Wed Jul 16 14:12:38 2003
--- spamass-milter.cpp.bobfix   Wed Jul 16 14:08:03 2003
***************
*** 350,355 ****
--- 350,356 ----
    string::size_type eoh2(assassin->d().find("\n\r\n"));
    string::size_type eoh = ( eoh1 < eoh2 ? eoh1 : eoh2 );
    string::size_type bob = assassin->d().find_first_not_of("\r\n", eoh);
+   bob = (bob == string::npos)? assassin->d().size() : bob;

    update_or_insert(assassin, ctx, assassin->spam_flag(),
&SpamAssassin::set_spam_flag, "X-Spam-Flag");
    update_or_insert(assassin, ctx, assassin->spam_status(),
&SpamAssassin::set_spam_status, "X-Spam-Status");



==
Valentin S. Chopov, CC[ND]P
Sys/Net Admin
SEI Data Inc.
E-Mail: address@hidden
==






reply via email to

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