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

Bug#913679: kopete: libjingle-call keeps crashing



Same problem here.

The reason are typos in the kopete-17.08.3-openssl-1.1.patch patch which is 
supposed to make the code work with openssl 1.1. There are two places where 
the patch does

+#if OPENSSL_VERSION_NUMBER < 0x10100000L
 static BIO_METHOD methods_socket = {
   BIO_TYPE_BIO,
   "socket",
@@ -98,16 +99,36 @@ static BIO_METHOD methods_socket = {
 };

 BIO_METHOD* BIO_s_socket2() { return(&methods_socket); }
+#else
+static BIO_METHOD *methods_socket = NULL;
+
+static const BIO_METHOD * BIO_s_socket2(void) {
+  if (methods_socket == NULL) {
+      methods_socket = BIO_meth_new (BIO_TYPE_BIO | BIO_get_new_index (), 
"socket");
+      if (methods_socket == NULL ||
+          BIO_meth_set_write (methods_socket, socket_write) ||
+          BIO_meth_set_read (methods_socket, socket_read) ||
+          BIO_meth_set_puts (methods_socket, socket_puts) ||
+          BIO_meth_set_gets (methods_socket, 0) ||
+          BIO_meth_set_ctrl (methods_socket, socket_ctrl) ||
+          BIO_meth_set_create (methods_socket, socket_new) ||
+          BIO_meth_set_destroy (methods_socket, socket_free))
+      return NULL;
+    }
+  return methods_socket;
+}
+#endif

The problem are the calls to the BIO_meth_set_XXX functions. Here it's an 
error if the return code is 0, not != 0! Therefore a correct patch would look 
like

+#if OPENSSL_VERSION_NUMBER < 0x10100000L
 static BIO_METHOD methods_socket = {
   BIO_TYPE_BIO,
   "socket",
@@ -98,16 +99,36 @@ static BIO_METHOD methods_socket = {
 };

 BIO_METHOD* BIO_s_socket2() { return(&methods_socket); }
+#else
+static BIO_METHOD *methods_socket = NULL;
+
+static const BIO_METHOD * BIO_s_socket2(void) {
+  if (methods_socket == NULL) {
+      methods_socket = BIO_meth_new (BIO_TYPE_BIO | BIO_get_new_index (), 
"socket");
+      if (methods_socket == NULL ||
+          !BIO_meth_set_write (methods_socket, socket_write) ||
+          !BIO_meth_set_read (methods_socket, socket_read) ||
+          !BIO_meth_set_puts (methods_socket, socket_puts) ||
+          !BIO_meth_set_gets (methods_socket, 0) ||
+          !BIO_meth_set_ctrl (methods_socket, socket_ctrl) ||
+          !BIO_meth_set_create (methods_socket, socket_new) ||
+          !BIO_meth_set_destroy (methods_socket, socket_free))
+      return NULL;
+    }
+  return methods_socket;
+}
+#endif

Again, the patch contains these calls twice so please make sure to fix both 
occurrences. And this problem applies to both kopete 17.08.3-2 (Sid) as well
as to kopete 18.08.3-1.

Please fix these packages because kopete seems to be the only available Jabber 
client on Plasma. Telepathy doesn't work for me...

Thanks!

Frank


Reply to: