[Secure Coding] master: Actually use strncat in the strncat example (805f9a8)

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

 



Repository : http://git.fedorahosted.org/git/?p=secure-coding.git

On branch  : master

>---------------------------------------------------------------

commit 805f9a85c843413140c867922bc2695cbbd1766a
Author: Florian Weimer <fweimer@xxxxxxxxxx>
Date:   Mon Sep 16 15:08:29 2013 +0200

    Actually use strncat in the strncat example
    
    Spotted by Thomas Miletich <thomas.miletich@xxxxxxxxx>.


>---------------------------------------------------------------

 defensive-coding/src/C-String-Functions.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/defensive-coding/src/C-String-Functions.c b/defensive-coding/src/C-String-Functions.c
index 34d9c31..9f8898a 100644
--- a/defensive-coding/src/C-String-Functions.c
+++ b/defensive-coding/src/C-String-Functions.c
@@ -70,7 +70,7 @@ main(void)
     assert(strncmp(buf, data, 9) == 0);
     //+ C String-Functions-strncat-as-strncpy
     buf[0] = '\0';
-    strncpy(buf, data, sizeof(buf) - 1);
+    strncat(buf, data, sizeof(buf) - 1);
     //-
   }
   {

--
security mailing list
security@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/security





[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Coolkey]

  Powered by Linux