[Python-bugs-list] [ python-Bugs-487703 ] Replace strcat, strcpy

noreply@sourceforge.net noreply@sourceforge.net
Thu, 15 Aug 2002 13:54:11 -0700


Bugs item #487703, was opened at 2001-11-30 23:39
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=487703&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Tim Peters (tim_one)
Summary: Replace strcat, strcpy

Initial Comment:
Alex Martelli sent this URL for a paper describing the 
safer strlcat and strlcpy functions:

>http://www.usenix.org/events/usenix99/full_papers/mill
ert/millert_html/>

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-08-15 22:54

Message:
Logged In: YES 
user_id=21627

I'm opposed to strlcat/strlcpy in the first place. It
usually starts long debates, and opponents usually argue
that it serves no real purpose, and gives a shallow feeling
of safety when there really is none. Proponents of strlcpy
are quite religious about spreading it quickly. For example,
there was a heated discussion about adding strlcpy to GNU
libc, after which glibc maintainers to ignore them.

I propose to do the same thing in Python.

----------------------------------------------------------------------

Comment By: Neil Schemenauer (nascheme)
Date: 2002-03-22 17:56

Message:
Logged In: YES 
user_id=35752


If they want people to use their code why do they put that
stupid clause in the license?  How annoying.  Attached is
a strlcpy function that I wrote based on the man page:

http://www.tac.eu.org/cgi-bin/man-cgi?strlcpy+3

Do whatever you like with it. :-)  I would appreciate it if
someone would review the code however.  There are a number
of corner cases that are easy to screw up.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-11 23:51

Message:
Logged In: YES 
user_id=6380

Strictly speaking, binary Python distributions would be
required to contain a copy of the entire license for that
file. I don't like that.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-12-03 19:59

Message:
Logged In: YES 
user_id=31435

I'm attaching a patch from Alex Martelli; haven't reviewed 
it, and don't expect to before 2.2 final is released.

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2001-12-03 11:47

Message:
Logged In: YES 
user_id=38388

Time for PyOS_strlcat() and PyOS_strlcpy() ? Looking at the web-site it seems that we could simply copy the 
code into the Python distro. I'd then suggest to bundle all the string helpers into a new file: e.g. mystrapis.c.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=487703&group_id=5470