NetBSD Problem Report #52779

From kre@munnari.OZ.AU  Sun Dec  3 08:59:58 2017
Return-Path: <kre@munnari.OZ.AU>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id D0FBA7A1E5
	for <>; Sun,  3 Dec 2017 08:59:58 +0000 (UTC)
Message-Id: <>
Date: Sun, 3 Dec 2017 15:59:33 +0700 (ICT)
From: kre@munnari.OZ.AU
Subject: strlcpy(3) omits important information (and is poor anyway)
X-Send-Pr-Version: 3.95

>Number:         52779
>Category:       lib
>Synopsis:       strlcpy(3) omits important information (and is poor anyway)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 03 09:00:00 +0000 2017
>Originator:     Robert Elz
>Release:        NetBSD 8.99.3
System: NetBSD 8.99.3 NetBSD 8.99.3 (MAGNOLIA-1.13-20170926) #43: Tue Sep 26 23:11:07 ICT 2017 amd64
Architecture: x86_64
Machine: amd64
	The man page for strlcpy(3) (and strncat(3) since it is the same one)
	makes no mention of whether overlapping buffer copies are safe or not.
	It should.

	That is, can a program do

		strlcpy(buf, buf+1, ...)
		strlcpy(buf+1, buf, ...)
	or even
		strlcpy(buf, buf, ...)

	(probably not as blatantly as that, but where the src happens to
	have been computed as a pointer into the dest string.)

	Same for strlcat() obviously - though perhaps it might provide
	a more likely use scenario.

	Beyond that, the man pages have way too much of the "why I was
	so great as to create this new function" which doesn't belong at
	all, it should just say what the functions do, what the args are,
	what restrictions are placed upon them, and what the results will
	be (and if it seems needed, an example - or even two).


	Rewrite the man page.   Almost completely.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.