commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 03/07: Addresses Defects 1046385 & 1046340:


From: git
Subject: [Commit-gnuradio] [gnuradio] 03/07: Addresses Defects 1046385 & 1046340: Buffer not NULL-terminated
Date: Sun, 30 Aug 2015 21:20:01 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit afa05059211c0e27ecb111500fc9628ba550eced
Author: Ben Hilburn <address@hidden>
Date:   Fri Aug 28 20:53:18 2015 -0700

    Addresses Defects 1046385 & 1046340: Buffer not NULL-terminated
    
    This was rather harmless. The only result was that the OS copied a character
    that would then get overwritten as a NULL buffer termination.
---
 gr-blocks/lib/tuntap_pdu_impl.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gr-blocks/lib/tuntap_pdu_impl.cc b/gr-blocks/lib/tuntap_pdu_impl.cc
index 4e01f45..45995e4 100644
--- a/gr-blocks/lib/tuntap_pdu_impl.cc
+++ b/gr-blocks/lib/tuntap_pdu_impl.cc
@@ -120,7 +120,7 @@ namespace gr {
        * specified type
        */
       if (*dev)
-        strncpy(ifr.ifr_name, dev, IFNAMSIZ);
+        strncpy(ifr.ifr_name, dev, IFNAMSIZ - 1);
 
       /* try to create the device */
       if ((err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]