asdfuser pushed a commit to branch master.

commit 262f05782b0c7285960a2e2d2beac9b778ce555f
Author: Daniel Willmann <[email protected]>
Date:   Mon Mar 18 12:21:45 2013 +0000

    embryo_cc: Fix possible buffer overflow in setconfig()
    
    Need to account for the space of the trailing '/' as well.
    
    Signed-off-by: Daniel Willmann <[email protected]>
---
 src/bin/embryo/embryo_cc_sc1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c
index 9fd7509..14b6b1c 100644
--- a/src/bin/embryo/embryo_cc_sc1.c
+++ b/src/bin/embryo/embryo_cc_sc1.c
@@ -683,7 +683,8 @@ setconfig(char *root)
         * to the list in that case
         */
        *(ptr + 1) = '\0';
-       if (strlen(path) < (sizeof(path) - 1 - 7))
+        /* Need room for 'include' and DIRSEP_CHAR - so 8 chars - and \0 */
+       if (strlen(path) < (sizeof(path) - 1 - 8))
          {
             strcat(path, "include");
          }

-- 

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar

Reply via email to