changeset 970:4c7a58ef26c1

2008-11-30 Brian Masney <masneyb@gftp.org> * src/gtk/delete_dialog.c - fixed call to g_strdup_printf() where too many arguments were passed in format string. * lib/sslcommon.c - removed duplicate data variable * src/uicommon/gftpui.c (gftpui_common_cmd_help) - fixed call to strncat() where the supplied length was too long
author masneyb
date Sun, 30 Nov 2008 17:55:04 +0000
parents e95ae20ddf0e
children 95da79b9e637
files ChangeLog lib/sslcommon.c src/gtk/delete_dialog.c src/uicommon/gftpui.c
diffstat 4 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Nov 30 14:41:36 2008 +0000
+++ b/ChangeLog	Sun Nov 30 17:55:04 2008 +0000
@@ -1,4 +1,12 @@
 2008-11-30 Brian Masney <masneyb@gftp.org>
+	* src/gtk/delete_dialog.c - fixed call to g_strdup_printf() where too
+	many arguments were passed in format string.
+
+	* lib/sslcommon.c - removed duplicate data variable
+
+	* src/uicommon/gftpui.c (gftpui_common_cmd_help) - fixed call to
+	strncat() where the supplied length was too long
+
 	* lib/ftps.c - warning fixes for the FTPS protocol when OpenSSL
 	support is disabled.
 
--- a/lib/sslcommon.c	Sun Nov 30 14:41:36 2008 +0000
+++ b/lib/sslcommon.c	Sun Nov 30 17:55:04 2008 +0000
@@ -139,7 +139,6 @@
  
           if (strcmp (extstr, "subjectAltName") == 0)
             {
-              unsigned char  *data;
               STACK_OF(CONF_VALUE) *val;
               CONF_VALUE   *nval;
               X509V3_EXT_METHOD *meth;
@@ -148,16 +147,14 @@
               if (!(meth = X509V3_EXT_get (ext)))
                 break;
 
-              data = ext->value->data;
-
 #if (OPENSSL_VERSION_NUMBER > 0x00907000L)
               if (meth->it)
-                ext_str = ASN1_item_d2i (NULL, &data, ext->value->length,
+                ext_str = ASN1_item_d2i (NULL, &ext->value->data, ext->value->length,
                                         ASN1_ITEM_ptr (meth->it));
               else
-                ext_str = meth->d2i (NULL, &data, ext->value->length);
+                ext_str = meth->d2i (NULL, &ext->value->data, ext->value->length);
 #else
-              ext_str = meth->d2i(NULL, &data, ext->value->length);
+              ext_str = meth->d2i(NULL, &ext->value->data, ext->value->length);
 #endif
               val = meth->i2v(meth, ext_str, NULL);
 
@@ -179,7 +176,7 @@
     }
 
   if (!ok && (subj = X509_get_subject_name (cert)) &&
-      X509_NAME_get_text_by_NID (subj, NID_commonName, data, 256) > 0)
+      X509_NAME_get_text_by_NID (subj, NID_commonName, data, sizeof (data)) > 0)
     {
       data[sizeof (data) - 1] = '\0';
       /* Check for wildcard CN (must begin with *.) */
--- a/src/gtk/delete_dialog.c	Sun Nov 30 14:41:36 2008 +0000
+++ b/src/gtk/delete_dialog.c	Sun Nov 30 17:55:04 2008 +0000
@@ -62,7 +62,7 @@
     }
   else if (transfer->numfiles > 0)
     {
-      tempstr = g_strdup_printf (_("Are you sure you want to delete these %ld files"), transfer->numfiles, transfer->numdirs);
+      tempstr = g_strdup_printf (_("Are you sure you want to delete these %ld files"), transfer->numfiles);
     }
   else if (transfer->numdirs > 0)
     {
--- a/src/uicommon/gftpui.c	Sun Nov 30 14:41:36 2008 +0000
+++ b/src/uicommon/gftpui.c	Sun Nov 30 17:55:04 2008 +0000
@@ -811,6 +811,7 @@
       for (i=0; i<numrows; i++)
         {
           strncpy (commands, "\t", sizeof (commands));
+          size_t cmd_len = sizeof(commands) - strlen (commands);
 
           for (j=0; j<numcols; j++)
             {
@@ -820,7 +821,8 @@
 
               g_snprintf (cmdstr, sizeof (cmdstr), "%-10s",
                           gftpui_common_commands[ele].command);
-              strncat (commands, cmdstr, sizeof (commands));
+              strncat (commands, cmdstr, cmd_len);
+              cmd_len -= strlen(cmdstr);
             }
           gftpui_common_logfunc (gftp_logging_misc_nolog, request, "%s\n",
                                  commands);