[Pkg-wmaker-commits] [wmcoincoin] 67/87: Fix buffer overflow

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Aug 28 17:27:42 UTC 2015


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

dtorrance-guest pushed a commit to branch master
in repository wmcoincoin.

commit e2f5a7ae5e4accef879cbaef70843507fb0cd8da
Author: SeeSchloss <mvalleton at noparking.net>
Date:   Tue Mar 24 17:29:07 2015 +0100

    Fix buffer overflow
---
 src/board.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/board.c b/src/board.c
index 1ffd111..9dfdaa0 100644
--- a/src/board.c
+++ b/src/board.c
@@ -2017,7 +2017,8 @@ regular_board_update_tsv(Board *board, HttpRequest *r) {
     length = strcspn(s, "\t");
     if (length) {
       char field[15];
-      strncpy(field, s, length);
+      unsigned l = MIN((sizeof field)-1, length);
+      strncpy(field, s, l); field[l] = 0;
       id = atoi(field);
       offset += length + 1;
     } else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmcoincoin.git



More information about the Pkg-wmaker-commits mailing list