Module Name:    src
Committed By:   rillig
Date:           Mon Sep  6 17:34:33 UTC 2021

Modified Files:
        src/external/bsd/openldap/dist/libraries/libldap: tls2.c

Log Message:
libldap: fix undefined behavior in ldap_int_tls_connect

The function isdigit must not be called with 'char' as argument.

https://bugs.openldap.org/show_bug.cgi?id=9668


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
    src/external/bsd/openldap/dist/libraries/libldap/tls2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/openldap/dist/libraries/libldap/tls2.c
diff -u src/external/bsd/openldap/dist/libraries/libldap/tls2.c:1.3 src/external/bsd/openldap/dist/libraries/libldap/tls2.c:1.4
--- src/external/bsd/openldap/dist/libraries/libldap/tls2.c:1.3	Sat Aug 14 16:14:56 2021
+++ src/external/bsd/openldap/dist/libraries/libldap/tls2.c	Mon Sep  6 17:34:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tls2.c,v 1.3 2021/08/14 16:14:56 christos Exp $	*/
+/*	$NetBSD: tls2.c,v 1.4 2021/09/06 17:34:33 rillig Exp $	*/
 
 /* tls.c - Handle tls/ssl. */
 /* $OpenLDAP$ */
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: tls2.c,v 1.3 2021/08/14 16:14:56 christos Exp $");
+__RCSID("$NetBSD: tls2.c,v 1.4 2021/09/06 17:34:33 rillig Exp $");
 
 #include "portable.h"
 #include "ldap_config.h"
@@ -396,7 +396,7 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn
 				break;
 			if ( *c == '.' )
 				continue;
-			if ( !isdigit( *c )) {
+			if ( !isdigit( (unsigned char)*c )) {
 				numeric = 0;
 				break;
 			}

Reply via email to