cpython/Python
Guido van Rossum fccfe89753 Another veeeeeery old patch...
Date:    Thu, 14 Sep 1995 12:18:20 -0400
From:    Alan Morse <alan@dvcorp.com>
To:      python-list@cwi.nl
Subject: getargs bug in 1.2 and 1.3 BETA

We have found a bug in the part of the getargs code that we added
and submitted, and which was incorporated into 1.1.

The parsing of "O?" format specifiers is not handled correctly;
there is no "else" for the "if" and therefore it can never fail.
What's worse, the advancing of the varargs pointer is not
handled properly, so from then on it is out of sync, wreaking
all sorts of havoc. (If it had failed properly, then the out-of-sync
varargs would not have been an issue.)

Below is the context diff for the change.

Note that I have made a few stylistic changes beyond adding the
else case, namely:

1) Making the "O" case follow the convention established by the other
format specifiers of getting all their vararg arguments before
performing the test, rather than getting some before and some after
the test passes.

2) Making the logic of the tests parallel, so the "if" part indicates
that the format is accepted and the "else" part indicates that the
format has failed. They were inconsistent with each other and with the
the other format specifiers.

-Alan Morse (amorse@dvcorp.com)
1998-05-15 22:04:07 +00:00
..
Makefile.in frozenmain.c is now also in the library, 1997-07-19 21:59:47 +00:00
atof.c New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
bltinmodule.c Implement round() slightly different, so that for negative ndigits no 1998-05-09 14:42:25 +00:00
ceval.c Since PyDict_GetItem() can't raise an exception any more, there's no 1998-05-14 02:16:20 +00:00
compile.c Since PyDict_GetItem() can't raise an exception any more, there's no 1998-05-14 02:16:20 +00:00
dup2.c MPW changes 1994-08-29 10:43:12 +00:00
errors.c Fix subtle bug in cleanup code in PyErr_NormalizeException(), detected 1997-12-09 14:11:39 +00:00
fmod.c New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
frozen.c Add primitive test for frozen package. 1998-04-03 21:10:36 +00:00
frozenmain.c Make calls into ../PC/frozen_dllmain.c on MS_WIN32. 1998-04-03 21:11:15 +00:00
getargs.c Another veeeeeery old patch... 1998-05-15 22:04:07 +00:00
getcompiler.c Make it return a _const_ char*. 1997-07-19 19:48:41 +00:00
getcopyright.c New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
getcwd.c New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
getmtime.c First part of package support. 1997-09-05 07:33:22 +00:00
getopt.c Fix a bug in this code that made it do the wrong thing when an option 1997-09-30 22:00:13 +00:00
getplatform.c Make it return a _const_ char*. 1997-07-19 19:48:41 +00:00
getversion.c Make it return a _const_ char*. 1997-07-19 19:48:41 +00:00
graminit.c Make first raise argument optional 1998-04-09 21:39:57 +00:00
hypot.c *** empty log message *** 1996-08-29 18:10:41 +00:00
import.c New APIs for embedding applications that want to add their own entries 1998-05-14 02:32:54 +00:00
importdl.c In debug mode on MS Windows, DLLs are called foo_d.pyd or foo_d.dll. 1998-05-15 20:22:08 +00:00
importdl.h First part of package support. 1997-09-05 07:33:22 +00:00
marshal.c Remove unnecessary PyErr_Clear(). 1998-05-14 02:31:26 +00:00
memmove.c New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
modsupport.c Plug memory leak in Py_BuildValue when using {...} to construct dictionaries. 1997-11-20 20:35:45 +00:00
mystrtoul.c Address warnings issued by the MSVC++ compiler 1998-04-10 21:52:06 +00:00
pyfpe.c Some patches to Lee Busby's fpectl mods that accidentally didn't make it 1997-10-20 23:50:01 +00:00
pystate.c /* An extension mechanism to store arbitrary additional per-thread state. 1998-04-10 20:18:25 +00:00
pythonmain.c Allow mac user to set "command line flags" by option-starting python. 1995-07-29 13:53:59 +00:00
pythonrun.c Translate E_INDENT to the clearest error message I can think of. 1998-04-10 19:43:42 +00:00
sigcheck.c Quickly renamed the remaining files -- this directory is done. 1997-04-29 20:08:16 +00:00
strdup.c Needed more includes... 1996-08-29 18:10:30 +00:00
strerror.c New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
strtod.c Always include config.h 1996-08-19 22:12:39 +00:00
structmember.c Quickly renamed the remaining files -- this directory is done. 1997-04-29 20:08:16 +00:00
sysmodule.c New APIs to write to sys.stdout or sys.stderr using a printf-like interface. 1998-05-12 14:59:24 +00:00
thread.c os2 patch by Jeff Rush 1997-11-22 21:53:48 +00:00
thread_cthread.h New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
thread_foobar.h New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
thread_lwp.h New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
thread_nt.h Use _beginthread() and _endthread() in favor of CreateThread() and 1997-08-14 20:12:58 +00:00
thread_os2.h os2 patch by Jeff Rush 1997-11-22 21:53:48 +00:00
thread_pthread.h Improved version of patch for HPUX from David Arnold. 1998-05-14 21:01:27 +00:00
thread_sgi.h Massive changes for separate thread state management. 1997-05-05 20:56:21 +00:00
thread_solaris.h New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
traceback.c PyFile_WriteString now returns an error indicator instead of calling 1997-05-22 22:35:47 +00:00