OSSP CVS Repository

ossp - Difference in ossp-pkg/sa/sa.c versions 1.4 and 1.5
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sa/sa.c 1.4 -> 1.5

--- sa.c 2001/10/05 11:40:22     1.4
+++ sa.c 2001/10/05 11:48:49     1.5
@@ -160,7 +160,11 @@
             }
             else if (c == 'd') {
                 d = (int)va_arg(ap, int);
-                sprintf(ibuf, "%d", d);
+#ifdef HAVE_SNPRINTF
+                snprintf(ibuf, sizeof(ibuf), "%d", d); /* inherently secure */
+#else
+                sprintf(ibuf, "%d", d); /* nevertheless secure; see ibuf above */
+#endif
                 n = strlen(ibuf);
                 memcpy(bufptr, ibuf, n);
                 bufptr += n;

CVSTrac 2.0.1