[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/khtml/java
From:       Matthias Kretz <kretz () kde ! org>
Date:       2008-08-04 17:42:56
Message-ID: 1217871776.099346.13482.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 842096 by mkretz:

don't abort on out-of-bounds access, the certsnr is the number of entries, there are \
two other entries before that, but indexing starts at 0... \
QString.toAscii().constData() returns a const char* from a temporary, not sure if it \
was a problem, but now it's safe

 M  +4 -2      kjavaappletserver.cpp  


--- trunk/KDE/kdelibs/khtml/java/kjavaappletserver.cpp #842095:842096
@@ -652,10 +652,12 @@
                 answer = "nossl";
             } else if (args.size() > 2) {
                 const int certsnr = args[1].toInt();
+                Q_ASSERT(args.size() > certsnr + 1);
                 QString text;
                 QList<KSSLCertificate *> certs;
-                for (int i = certsnr; i >= 0; --i) {
-                    KSSLCertificate * cert = \
KSSLCertificate::fromString(args[i+2].toAscii().constData()); +                for \
(int i = certsnr - 1; i >= 0; --i) { +                    const QByteArray &arg = \
args[i + 2].toAscii(); +                    KSSLCertificate * cert = \
KSSLCertificate::fromString(arg.constData());  if (cert) {
                         certs.prepend(cert);
                         if (cert->isSigner())


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic