[Python-checkins] r45947 - in python/trunk: Modules/_csv.c Modules/_elementtree.c Modules/_ssl.c Objects/longobject.c

Neal Norwitz nnorwitz at gmail.com
Thu May 11 06:38:46 CEST 2006


On 5/10/06, Thomas Wouters <thomas at python.org> wrote:
>
>
> On 5/10/06, neal.norwitz <python-checkins at python.org> wrote:
> > Modified: python/trunk/Modules/_ssl.c
> >
> ==============================================================================
> > --- python/trunk/Modules/_ssl.c (original)
> > +++ python/trunk/Modules/_ssl.c Wed May 10 08:57:58 2006
> > @@ -183,9 +183,9 @@
> >         int sockstate;
> >
> >         self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new
> object */
> > -       if (self == NULL){
> > -               errstr = "newPySSLObject error";
> > -               goto fail;
> > +       if (self == NULL) {
> > +               PyErr_SetString(PySSLErrorObject,
> "newPySSLObject error");
> > +               return NULL;
> >         }
> >         memset(self->server, '\0', sizeof(char) * X509_NAME_MAXLEN);
> >         memset(self->issuer, '\0', sizeof(char) * X509_NAME_MAXLEN);
>
>
> Is there a reason this clobbers the exception set by PyObject_New()?
> (Especially considering the useless error message the new exception contains
> :)

Good point.  I didn't even think about changing the code, I was just
fixing the Coverity warnings.  I think MAL originally wrote this code.
 It doesn't seem like we should set the error here.  MAL?

n


More information about the Python-checkins mailing list