From: John Darrington Date: Thu, 5 Jan 2012 06:47:58 +0000 (+0100) Subject: lex_get_text_buffer_read: Avoid potential buffer overflow. X-Git-Tag: v0.7.9~47 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa2cd68fb42668614f168df3a319e48d009c3cc7;p=pspp-builds.git lex_get_text_buffer_read: Avoid potential buffer overflow. --- diff --git a/src/ui/gui/psppire-lex-reader.c b/src/ui/gui/psppire-lex-reader.c index 5afd1015..ae043b0b 100644 --- a/src/ui/gui/psppire-lex-reader.c +++ b/src/ui/gui/psppire-lex-reader.c @@ -81,7 +81,7 @@ lex_gtk_text_buffer_read (struct lex_reader *r_, char *buf, size_t n, s = gtk_text_iter_get_text (&r->start, &iter); - strcpy (buf, s); + strncpy (buf, s, n_chars); r->start = iter;