keep gcc from grumbling
authorPaul <paul@claws-mail.org>
Tue, 8 Sep 2020 12:21:43 +0000 (13:21 +0100)
committerPaul <paul@claws-mail.org>
Tue, 8 Sep 2020 12:21:43 +0000 (13:21 +0100)
src/gtk/sslcertwindow.c

index 32c8e7b0c3d1cbbeabed1a3ca92d1512b13aa3dc..688797139cbfb0f698baca8f0997ba850cde1c4c 100644 (file)
@@ -84,14 +84,14 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
        n = BUFFSIZE;
        if (gnutls_x509_crt_get_issuer_dn_by_oid(cert->x509_cert, 
                GNUTLS_OID_X520_COMMON_NAME, 0, 0, issuer_commonname, &n))
-               strncpy(issuer_commonname, _("<not in certificate>"), BUFFSIZE);
+               strncpy(issuer_commonname, _("<not in certificate>"), BUFFSIZE-1);
        n = BUFFSIZE;
 
        if (gnutls_x509_crt_get_issuer_dn_by_oid(cert->x509_cert, 
                GNUTLS_OID_X520_LOCALITY_NAME, 0, 0, issuer_location, &n)) {
                if (gnutls_x509_crt_get_issuer_dn_by_oid(cert->x509_cert, 
                        GNUTLS_OID_X520_COUNTRY_NAME, 0, 0, issuer_location, &n)) {
-                       strncpy(issuer_location, _("<not in certificate>"), BUFFSIZE);
+                       strncpy(issuer_location, _("<not in certificate>"), BUFFSIZE-1);
                }
        } else {
                tmp = g_malloc(BUFFSIZE);
@@ -106,19 +106,19 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
        n = BUFFSIZE;
        if (gnutls_x509_crt_get_issuer_dn_by_oid(cert->x509_cert, 
                GNUTLS_OID_X520_ORGANIZATION_NAME, 0, 0, issuer_organization, &n))
-               strncpy(issuer_organization, _("<not in certificate>"), BUFFSIZE);
+               strncpy(issuer_organization, _("<not in certificate>"), BUFFSIZE-1);
 
        n = BUFFSIZE;
        if (gnutls_x509_crt_get_dn_by_oid(cert->x509_cert, 
                GNUTLS_OID_X520_COMMON_NAME, 0, 0, subject_commonname, &n))
-               strncpy(subject_commonname, _("<not in certificate>"), BUFFSIZE);
+               strncpy(subject_commonname, _("<not in certificate>"), BUFFSIZE-1);
        n = BUFFSIZE;
 
        if (gnutls_x509_crt_get_dn_by_oid(cert->x509_cert, 
                GNUTLS_OID_X520_LOCALITY_NAME, 0, 0, subject_location, &n)) {
                if (gnutls_x509_crt_get_dn_by_oid(cert->x509_cert, 
                        GNUTLS_OID_X520_COUNTRY_NAME, 0, 0, subject_location, &n)) {
-                       strncpy(subject_location, _("<not in certificate>"), BUFFSIZE);
+                       strncpy(subject_location, _("<not in certificate>"), BUFFSIZE-1);
                }
        } else {
                tmp = g_malloc(BUFFSIZE);
@@ -133,7 +133,7 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
        n = BUFFSIZE;
        if (gnutls_x509_crt_get_dn_by_oid(cert->x509_cert, 
                GNUTLS_OID_X520_ORGANIZATION_NAME, 0, 0, subject_organization, &n))
-               strncpy(subject_organization, _("<not in certificate>"), BUFFSIZE);
+               strncpy(subject_organization, _("<not in certificate>"), BUFFSIZE-1);
                
        exp_time_t = gnutls_x509_crt_get_expiration_time(cert->x509_cert);