I just ran some static analysis of the python core 2.5 with Visual Studio team 
system.
There was the stray error discovered.  I will update the most obvious ones.

Some questions, though:

This code in binascii.c, line 1168 (and again 1238) is wrong:
while (in < datalen) {
            if ((data[in] > 126) ||
                (data[in] == '=') ||
                (header && data[in] == '_') ||
                ((data[in] == '.') && (linelen == 1)) ||
                (!istext && ((data[in] == '\r') || (data[in] == '\n'))) ||
                ((data[in] == '\t' || data[in] == ' ') && (in + 1 == datalen)) 
||
                ((data[in] < 33) &&
                 (data[in] != '\r') && (data[in] != '\n') &&
                 (quotetabs && ((data[in] != '\t') || (data[in] != ' ')))))
      The final ((data[in] != '\t') || (data[in] != ' ')) is always true.  What 
is the right form? ((data[in] == '\t') || (data[in] == ' '))  ?

1)

2)  There is a lot of code that goes like this:
f->buf = PyMem_Realloc(f->buf, newsize);
if (!f->buf)
    return PyErr_NoMemory(), 0;
Now,  this if Realloc fails, this causes a memory leak.  Is there any interest 
to fix this flawed pattern wholesale?
Cheers,
Kristjan


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to