pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/misc/kdepimlibs4 Passing non-POD types to variadic fun...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/29d446ff438b
branches:  trunk
changeset: 641681:29d446ff438b
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Nov 14 22:23:40 2014 +0000

description:
Passing non-POD types to variadic function is still UB.

diffstat:

 misc/kdepimlibs4/distinfo                            |   5 +-
 misc/kdepimlibs4/patches/patch-kldap_ber.cpp         |  46 ++++++++++++++++++++
 misc/kdepimlibs4/patches/patch-kldap_ber.h           |  25 ++++++++++
 misc/kdepimlibs4/patches/patch-kldap_ldapcontrol.cpp |  22 +++++++++
 4 files changed, 97 insertions(+), 1 deletions(-)

diffs (123 lines):

diff -r 178db28b392f -r 29d446ff438b misc/kdepimlibs4/distinfo
--- a/misc/kdepimlibs4/distinfo Fri Nov 14 22:03:14 2014 +0000
+++ b/misc/kdepimlibs4/distinfo Fri Nov 14 22:23:40 2014 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.30 2014/11/13 19:19:06 markd Exp $
+$NetBSD: distinfo,v 1.31 2014/11/14 22:23:40 joerg Exp $
 
 SHA1 (kdepimlibs-4.14.3.tar.xz) = bbfff3ea5775bfb0f1692828c679e549deaf4fb3
 RMD160 (kdepimlibs-4.14.3.tar.xz) = 95af39ad4848fe48efbd4e3be8b4b0767530ec60
@@ -6,5 +6,8 @@
 SHA1 (patch-gpgmexx_config-gpgmexx.h.cmake) = bd8fd1e9a619d6bd52185f37adb5dc7f7b97423c
 SHA1 (patch-kblog_CMakeLists.txt) = b03068672c39492ef4883125c65f7951c7cc8f01
 SHA1 (patch-kimap_loginjob.cpp) = 8a0fe3c1779b981d9c9ca6cb34121219f2f97c9f
+SHA1 (patch-kldap_ber.cpp) = 8f2cf67ee39f744b2114b6cba503f9bcdb2efacc
+SHA1 (patch-kldap_ber.h) = 19162970d42a50f30bc62c4d23b2fa3e8d57322a
+SHA1 (patch-kldap_ldapcontrol.cpp) = 88be1a0ff3e8de7e68ee786c05989603c9628ed2
 SHA1 (patch-kpimidentities_identity.cpp) = 5a7d7e0c8edb7d2855c0e18bb6e9c596efbfe615
 SHA1 (patch-qgpgme_CMakeLists.txt) = 0860963f371a008f1d006dad58ea40329c358cfd
diff -r 178db28b392f -r 29d446ff438b misc/kdepimlibs4/patches/patch-kldap_ber.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/kdepimlibs4/patches/patch-kldap_ber.cpp      Fri Nov 14 22:23:40 2014 +0000
@@ -0,0 +1,46 @@
+$NetBSD: patch-kldap_ber.cpp,v 1.4 2014/11/14 22:23:40 joerg Exp $
+
+Fix building with Clang.
+
+--- kldap/ber.cpp.orig 2014-11-14 14:44:22.000000000 +0000
++++ kldap/ber.cpp
+@@ -124,7 +124,7 @@ QByteArray Ber::flatten() const
+   return ret;
+ }
+ 
+-int Ber::printf( const QString &format, ... )
++int Ber::printf( const char *format, ... )
+ {
+   char fmt[2];
+   va_list args;
+@@ -132,8 +132,8 @@ int Ber::printf( const QString &format, 
+   fmt[1] = '\0';
+ 
+   int i = 0, ret = 0;
+-  while ( i < format.length() ) {
+-    fmt[0] = format[i].toLatin1();
++  while ( format[i] ) {
++    fmt[0] = format[i];
+     i++;
+     switch ( fmt[0] ) {
+       case 'b':
+@@ -229,7 +229,7 @@ int Ber::printf( const QString &format, 
+   return ret;
+ }
+ 
+-int Ber::scanf( const QString &format, ... )
++int Ber::scanf( const char *format, ... )
+ {
+   char fmt[2];
+   va_list args;
+@@ -237,8 +237,8 @@ int Ber::scanf( const QString &format, .
+   fmt[1] = '\0';
+ 
+   int i = 0, ret = 0;
+-  while ( i < format.length() ) {
+-    fmt[0] = format[i].toLatin1();
++  while ( format[i] ) {
++    fmt[0] = format[i];
+     i++;
+     switch ( fmt[0] ) {
+       case 'l':
diff -r 178db28b392f -r 29d446ff438b misc/kdepimlibs4/patches/patch-kldap_ber.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/kdepimlibs4/patches/patch-kldap_ber.h        Fri Nov 14 22:23:40 2014 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-kldap_ber.h,v 1.3 2014/11/14 22:23:40 joerg Exp $
+
+--- kldap/ber.h.orig   2014-11-04 21:19:27.000000000 +0000
++++ kldap/ber.h
+@@ -57,7 +57,8 @@ class KLDAP_EXPORT Ber
+ 
+     /**
+      * Appends the data with the specified format to the Ber object.
+-     * This function works like printf, except that it's appending the
++     * This function works like 
++     printf, except that it's appending the
+      * parameters, not replacing them. The allowed format characters and
+      * the expected parameter types are:
+      * <ul>
+@@ -114,8 +115,8 @@ class KLDAP_EXPORT Ber
+      *   </li>
+      * </ul>
+      */
+-    int printf( const QString &format, ... );
+-    int scanf( const QString &format, ... );
++    int printf( const char *format, ... );
++    int scanf( const char *format, ... );
+     unsigned int peekTag( int &size );
+     unsigned int skipTag( int &size );
+ 
diff -r 178db28b392f -r 29d446ff438b misc/kdepimlibs4/patches/patch-kldap_ldapcontrol.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/kdepimlibs4/patches/patch-kldap_ldapcontrol.cpp      Fri Nov 14 22:23:40 2014 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-kldap_ldapcontrol.cpp,v 1.1 2014/11/14 22:23:40 joerg Exp $
+
+--- kldap/ldapcontrol.cpp.orig 2014-11-14 15:54:02.000000000 +0000
++++ kldap/ldapcontrol.cpp
+@@ -124,7 +124,7 @@ int LdapControl::parsePageControl( QByte
+ 
+   Ber ber( d->mValue );
+   int size;
+-  if ( ber.scanf( QLatin1String("{iO}"), &size, &cookie ) == -1 ) {
++  if ( ber.scanf( "{iO}", &size, &cookie ) == -1 ) {
+     return -1;
+   } else {
+     return size;
+@@ -136,7 +136,7 @@ LdapControl LdapControl::createPageContr
+   LdapControl control;
+   Ber ber;
+ 
+-  ber.printf( QLatin1String("{iO}"), pagesize, &cookie );
++  ber.printf( "{iO}", pagesize, &cookie );
+   control.setOid( QLatin1String("1.2.840.113556.1.4.319") );
+   control.setValue( ber.flatten() );
+   return control;



Home | Main Index | Thread Index | Old Index