[Kst] kdeextragear-2/kst/kst/extensions/elog [POSSIBLY UNSAFE]
George Staikos
staikos at kde.org
Thu Oct 7 15:23:58 CEST 2004
CVS commit by staikos:
more instances of base64_encode
M +7 -6 elogeventthreadsubmit.cpp 1.5 [POSSIBLY UNSAFE: printf]
M +0 -1 elogthread.h 1.6
M +6 -9 elogthreadattrs.cpp 1.6 [POSSIBLY UNSAFE: printf]
M +2 -2 elogthreadsubmit.cpp 1.13 [POSSIBLY UNSAFE: printf]
--- kdeextragear-2/kst/kst/extensions/elog/elogeventthreadsubmit.cpp #1.4:1.5
@@ -31,14 +31,15 @@
#include <signal.h>
-#include <qiodevice.h>
#include <qbuffer.h>
#include <qcstring.h>
-#include <qtextstream.h>
#include <qdatastream.h>
+#include <qiodevice.h>
+#include <qtextstream.h>
#include <kaction.h>
#include <klocale.h>
-#include <kmessagebox.h>
+#include <kmdcodec.h>
#include <kmdimainfrm.h>
+#include <kmessagebox.h>
#include "elogeventthreadsubmit.h"
@@ -94,5 +95,5 @@ void ElogEventThreadSubmit::doTransmit(i
char request[100000];
char response[100000];
- char boundary[80], str[80], *p;
+ char boundary[80], *p;
int i, n, header_length, content_length;
int iAttachment = 0;
@@ -184,6 +185,6 @@ void ElogEventThreadSubmit::doTransmit(i
if (!_strWritePassword.isEmpty()) {
- base64_encode(_strWritePassword.ascii(), str);
- sprintf(request + strlen(request), "Cookie: wpwd=%s\r\n", str);
+ QCString str = KCodecs::base64Encode(_strWritePassword.ascii());
+ sprintf(request + strlen(request), "Cookie: wpwd=%s\r\n", str.data());
}
--- kdeextragear-2/kst/kst/extensions/elog/elogthread.h #1.5:1.6
@@ -34,5 +34,4 @@ class ElogThread : public QThread {
int makeConnection( int* psock, int* pstatus );
- void base64_encode( const char *s, char *d );
void addAttachment( int* piContentLength, char** pp, const char* boundary, QByteArray* pByteArray, int iFileNumber, const char* pName );
void addAttribute( char* content, const char* boundary, const char* value, const QString& str, bool bEncode );
--- kdeextragear-2/kst/kst/extensions/elog/elogthreadattrs.cpp #1.5:1.6
@@ -41,6 +41,7 @@
#include <kaction.h>
#include <klocale.h>
-#include <kmessagebox.h>
+#include <kmdcodec.h>
#include <kmdimainfrm.h>
+#include <kmessagebox.h>
#include "elogthreadattrs.h"
@@ -56,8 +57,4 @@ ElogThreadAttrs::~ElogThreadAttrs() {
void ElogThreadAttrs::doTransmit(int sock) {
- QStringList strListAttributes;
- QStringList strListAttribute;
- QString strSplit( "\n" );
- QString strSplitAttribute( "=" );
QString strUserName;
QString strUserPassword;
@@ -90,6 +87,6 @@ void ElogThreadAttrs::doTransmit(int soc
}
bFirst = FALSE;
- base64_encode(strWritePassword.ascii(), str);
- sprintf(request + strlen(request), "wpwd=%s;", str);
+ QCString str = KCodecs::base64Encode(strWritePassword.ascii());
+ sprintf(request + strlen(request), "wpwd=%s;", str.data());
}
@@ -107,6 +104,6 @@ void ElogThreadAttrs::doTransmit(int soc
}
bFirst = FALSE;
- base64_encode(strUserPassword.ascii(), str);
- sprintf(request + strlen(request), "upwd=%s;", str);
+ KCodecs::base64Encode(strUserPassword.ascii());
+ sprintf(request + strlen(request), "upwd=%s;", str.data());
}
--- kdeextragear-2/kst/kst/extensions/elog/elogthreadsubmit.cpp #1.12:1.13
@@ -184,6 +184,6 @@ void ElogThreadSubmit::doTransmit(int so
if (!_strWritePassword.isEmpty()) {
- base64_encode(_strWritePassword.ascii(), str);
- sprintf(request + strlen(request), "Cookie: wpwd=%s\r\n", str);
+ QCString enc = KCodecs::base64Encode(_strWritePassword.ascii());
+ sprintf(request + strlen(request), "Cookie: wpwd=%s\r\n", enc.data());
}
More information about the Kst
mailing list