[Xfce4-commits] [apps/xfce4-terminal] 01/01: Prevent possible buffer overwrite

noreply at xfce.org noreply at xfce.org
Tue Aug 2 10:21:25 CEST 2016


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

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 81c8999b3a6c34100d2d992e42a18f351990a697
Author: Igor <f2404 at yandex.ru>
Date:   Tue Aug 2 11:20:35 2016 +0300

    Prevent possible buffer overwrite
    
    Issue found by Coverity
    https://www.securecoding.cert.org/confluence/display/c/POS30-C.+Use+the+readlink()+function+properly
---
 terminal/terminal-screen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 974da65..f2f75d5 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1939,7 +1939,7 @@ terminal_screen_get_working_directory (TerminalScreen *screen)
       file = g_strdup_printf ("/proc/%d/cwd", screen->pid);
 #endif
 
-      length = readlink (file, buffer, sizeof (buffer));
+      length = readlink (file, buffer, sizeof (buffer) - 1);
       if (length > 0 && *buffer == '/')
         {
           buffer[length] = '\0';

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list