diff options
| author | Jim Meyering | 2012-05-02 18:12:13 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-05-02 18:12:13 +0800 |
| commit | bf98199cf1bea244378538d60838f81cb3a34b49 (patch) | |
| tree | ee8ffe8445eb073346878b4eb2731264c97c599e /src | |
| parent | cd3771a08b8a1fed5aa91eb2ac559d41801668ea (diff) | |
| download | emacs-bf98199cf1bea244378538d60838f81cb3a34b49.tar.gz emacs-bf98199cf1bea244378538d60838f81cb3a34b49.zip | |
Add NUL-termination to some uses of strncpy.
* lib-src/pop.c (pop_stat, pop_list, pop_multi_first, pop_last):
NUL-terminate the error buffer.
* src/w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/w32font.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e2eb95f60d0..8aa1707cd30 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-05-02 Jim Meyering <meyering@redhat.com> | ||
| 2 | |||
| 3 | * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372). | ||
| 4 | |||
| 1 | 2012-04-29 Eli Zaretskii <eliz@gnu.org> | 5 | 2012-04-29 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * xdisp.c (pos_visible_p): If already at a newline from the | 7 | * xdisp.c (pos_visible_p): If already at a newline from the |
diff --git a/src/w32font.c b/src/w32font.c index dab9f4c61b4..8badace9635 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -2045,8 +2045,11 @@ fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec) | |||
| 2045 | /* Font families are interned, but allow for strings also in case of | 2045 | /* Font families are interned, but allow for strings also in case of |
| 2046 | user input. */ | 2046 | user input. */ |
| 2047 | else if (SYMBOLP (tmp)) | 2047 | else if (SYMBOLP (tmp)) |
| 2048 | strncpy (logfont->lfFaceName, | 2048 | { |
| 2049 | SDATA (ENCODE_SYSTEM (SYMBOL_NAME (tmp))), LF_FACESIZE); | 2049 | strncpy (logfont->lfFaceName, |
| 2050 | SDATA (ENCODE_SYSTEM (SYMBOL_NAME (tmp))), LF_FACESIZE); | ||
| 2051 | logfont->lfFaceName[LF_FACESIZE-1] = '\0'; | ||
| 2052 | } | ||
| 2050 | } | 2053 | } |
| 2051 | 2054 | ||
| 2052 | tmp = AREF (font_spec, FONT_ADSTYLE_INDEX); | 2055 | tmp = AREF (font_spec, FONT_ADSTYLE_INDEX); |