[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdepim/kioslaves/sieve
From: Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date: 2003-05-15 18:02:20
[Download RAW message or body]
CVS commit by mutz:
Fix *some* fishy code in the light of recent IMAP literal vulnerabilities; comment \
out client/server echoing to kdDebug()
M +11 -9 sieve.cpp 1.7
--- kdepim/kioslaves/sieve/sieve.cpp #1.6:1.7
@@ -925,5 +925,5 @@ bool kio_sieveProtocol::sendData(const Q
QCString write_buf = data + "\r\n";
- ksDebug() << "C: " << data << endl;
+ //ksDebug() << "C: " << data << endl;
// Write the command
@@ -952,4 +952,5 @@ bool kio_sieveProtocol::receiveData(bool
char buffer[SIEVE_DEFAULT_RECIEVE_BUFFER];
readLine(buffer, SIEVE_DEFAULT_RECIEVE_BUFFER - 1);
+ buffer[SIEVE_DEFAULT_RECIEVE_BUFFER-1] = '\0';
// strip LF/CR
@@ -962,22 +963,23 @@ bool kio_sieveProtocol::receiveData(bool
r.clear();
- ksDebug() << "S: " << interpret << endl;
+ //ksDebug() << "S: " << interpret << endl;
switch(interpret[0]) {
case '{':
+ {
// expecting {quantity}
start = 0;
end = interpret.find('}', start + 1);
- r.setQuantity(interpret.mid(start + 1, end - start - \
1).toUInt(/* *err */));
- // FIXME
- /*if (*err) {
- delete err;
+ bool ok = false;
+ r.setQuantity(interpret.mid(start + 1, end - start - \
1).toUInt( &ok )); + if (!ok) {
disconnect();
- error(ERR_COULD_NOT_LOGIN, i18n("A protocol error \
occurred."));
- return;
- }*/
+ error(ERR_INTERNAL_SERVER, i18n("A protocol error \
occurred.")); + return false;
+ }
return true;
+ }
case '"':
// expecting "key" "value" pairs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic