misc/152042: wrong bufsize of __hdtoa

看板FB_bugs作者時間15年前 (2010/11/08 18:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
>Number: 152042 >Category: misc >Synopsis: wrong bufsize of __hdtoa >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 08 09:40:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Yui NARUSE >Release: 8.1-RELEASE >Organization: >Environment: FreeBSD windy.airemix.net 8.1-RELEASE FreeBSD 8.1-RELEASE #1: Sat Jul 24 11:27:04 JST 2010 naruse@windy.airemix.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: When ndigits is given for __hdtoa, the bufsize for rv_alloc is too small. It must add 1 for NUL termination. >How-To-Repeat: >Fix: /usr/src/lib/libc/gdtoa % diff -u _hdtoa.c _hdtoa.c.orig --- _hdtoa.c 2010-11-08 18:31:46.000000000 +0900 +++ _hdtoa.c.orig 2010-11-08 18:31:44.000000000 +0900 @@ -109,7 +109,7 @@ * enough space for all the digits. */ bufsize = (ndigits > 0) ? ndigits : SIGFIGS; - s0 = rv_alloc(bufsize); + s0 = rv_alloc(bufsize+1); /* Round to the desired number of digits. */ if (SIGFIGS > ndigits && ndigits > 0) { >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
文章代碼(AID): #1CryfV0l (FB_bugs)