In message <http://marc.info/?l=openbsd-tech&m=121183803128128&w=1>,
"Ted Unangst" <ted.unangst () gmail ! com> pointed out that
# strlcpy is wrong with overlapping arguments.
Should this be mentioned in the strlcpy/strlcat man page?
(It isn't as of 4.3-release.) Here's a suggested patch:
Index: strlcpy.3
===================================================================
RCS file: /cvs/src/lib/libc/string/strlcpy.3,v
retrieving revision 1.19
diff -u -r1.19 strlcpy.3
--- strlcpy.3 31 May 2007 19:19:32 -0000 1.19
+++ strlcpy.3 27 May 2008 10:51:45 -0000
@@ -88,6 +88,17 @@
It will append at most
.Fa size
- strlen(dst) - 1 bytes, NUL-terminating the result.
+.Pp
+.Fa src
+and
+.Fa dst
+must not overlap, i.e., no character copied by
+.Fn strlcpy
+or
+.Fn strlcat
+may be within the initial
+.Fa dst
+string.
.Sh RETURN VALUES
The
.Fn strlcpy
ciao,
--
-- Jonathan Thornburg (remove -animal to reply) <J.Thornburg@soton.ac-zebra.uk>
School of Mathematics, U of Southampton, England
"Washing one's hands of the conflict between the powerful and the
powerless means to side with the powerful, not to be neutral."
-- quote by Freire / poster by Oxfam
| jmerkey | [ANNOUNCE] Merkey's Kernel Debugger |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Harald Dunkel | 2.6.25.3: su gets stuck for root |
git: | |
| Peter Stahlir | Git as a filesystem |
| Linus Torvalds | Help with a tcl/tk gui thing.. |
| Jon Smirl | ! [rejected] master -> master (non-fast forward) |
| Wink Saville | Resolving conflicts |
| Kevin Neff | Patching a SSH 'Weakness' |
| Mayuresh Kathe | Re: What is our ultimate goal?? |
| Doug Fordham | Re: Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Eric Dumazet | Re: [PATCH] net: implement emergency route cache rebulds when gc_elasticity is exc... |
| Arnaldo Carvalho de Melo | Re: [PATCH 2/6] Phonet: connected sockets glue |
