Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Feb 2016 10:38:34 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 207302] Iconv uses strlen directly on user supplied memory
Message-ID:  <bug-207302-8-PQXjLp6niz@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-207302-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-207302-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207302

--- Comment #1 from CTurt <cturt@hardenedbsd.org> ---
Patch:
https://github.com/HardenedBSD/hardenedBSD-playground/commit/1bcd4a2c6f3a25=
6b2db03fc9421857a7f7963f34.patch

It may potentially be more pleasing to use:

    if (strnlen(din.ia_from, ICONV_CSNMAXLEN) >=3D ICONV_CSNMAXLEN)

But I opted for using `sizeof` on the string instead:

    if (strnlen(din.ia_from, sizeof(din.ia_from)) >=3D ICONV_CSNMAXLEN)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-207302-8-PQXjLp6niz>