aprovy / spserver

Automatically exported from code.google.com/p/spserver
Other
0 stars 0 forks source link

VS2010 Code Analysis Warnings #44

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, just a small issue you may not be aware of, VS2010 code analysis outputs 
the following when run against spserver.lib

1>e:\svn\spserver-read-only\spserver\sphttp.cpp(224): warning C6053: Call to 
'strncpy' might not zero-terminate string 'keepAlive': Lines: 155, 156, 158, 
160, 161, 163, 165, 167, 168, 170, 173, 174, 179, 189, 190, 191, 192, 193, 194, 
197, 201, 207, 209, 210, 211, 215, 219, 222, 224
1>e:\svn\spserver-read-only\spserver\sphttpmsg.cpp(66): warning C6011: 
Dereferencing NULL pointer 'line': Lines: 58, 60, 61, 62, 64, 65, 66
1>e:\svn\spserver-read-only\spserver\sphttpmsg.cpp(74): warning C6387: 
'argument 1' might be '0': this does not adhere to the specification for the 
function '_strnicmp': Lines: 58, 60, 61, 62, 64, 65, 66, 68, 70, 71, 72, 74
1>e:\svn\spserver-read-only\spserver\sphttpmsg.cpp(115): warning C6011: 
Dereferencing NULL pointer 'line': Lines: 107, 109, 110, 111, 113, 114, 115
1>e:\svn\spserver-read-only\spserver\sphttpmsg.cpp(147): warning C6031: Return 
value ignored: 'strtok'
1>e:\svn\spserver-read-only\spserver\sphttpmsg.cpp(362): warning C6308: 
'realloc' might return null pointer: assigning null pointer to 'mContent', 
which is passed as an argument to 'realloc', will cause the original memory 
block to be leaked
1>e:\svn\spserver-read-only\spserver\sphttpmsg.cpp(370): warning C6011: 
Dereferencing NULL pointer 'mContent': Lines: 353, 355, 356, 358, 359, 362, 
364, 367, 368, 370
1>e:\svn\spserver-read-only\spserver\spiocpdispatcher.cpp(165): warning C6011: 
Dereferencing NULL pointer 'arg': Lines: 149, 150, 153, 154, 156, 161, 153, 
154, 156, 161, 153, 154, 156, 161, 162, 164, 165
1>e:\svn\spserver-read-only\spserver\spiocpdispatcher.cpp(267): warning C6011: 
Dereferencing NULL pointer 'arg': Lines: 265, 267
1>e:\svn\spserver-read-only\spserver\spiocpdispatcher.cpp(311): warning C6011: 
Dereferencing NULL pointer 'arg': Lines: 309, 311
1>e:\svn\spserver-read-only\spserver\spiocplfserver.cpp(38): warning C6011: 
Dereferencing NULL pointer 'mAcceptArg': Lines: 26, 27, 29, 30, 32, 34, 36, 37, 
38
1>e:\svn\spserver-read-only\spserver\spiocpserver.cpp(268): warning C6011: 
Dereferencing NULL pointer 'arg': Lines: 205, 206, 208, 210, 212, 213, 214, 
216, 217, 219, 223, 224, 226, 227, 228, 229, 230, 231, 233, 234, 236, 242, 243, 
244, 245, 251, 252, 253, 256, 257, 259, 264, 256, 257, 259, 264, 256, 257, 259, 
264, 265, 267, 268
1>e:\svn\spserver-read-only\spserver\spmsgdecoder.cpp(149): warning C6011: 
Dereferencing NULL pointer 'mBuffer': Lines: 133, 138, 140, 144, 145, 147, 148, 
149
1>e:\svn\spserver-read-only\spserver\spmsgdecoder.cpp(271): warning C6011: 
Dereferencing NULL pointer 'ret': Lines: 264, 265, 270, 271
1>e:\svn\spserver-read-only\spserver\spresponse.cpp(45): warning C6011: 
Dereferencing NULL pointer 'p': Lines: 44, 45
1>e:\svn\spserver-read-only\spserver\spsession.cpp(48): warning C6246: Local 
declaration of 'i' hides declaration of the same name in outer scope. For 
additional information, see previous declaration at line '44' of 
'e:\svn\spserver-read-only\spserver\spsession.cpp': Lines: 44
1>e:\svn\spserver-read-only\spserver\spsession.cpp(79): warning C6011: 
Dereferencing NULL pointer 'mArray[avail]': Lines: 63, 65, 66, 67, 68, 67, 68, 
67, 68, 69, 74, 75, 76, 78, 79
1>e:\svn\spserver-read-only\spserver\spsession.cpp(91): warning C6011: 
Dereferencing NULL pointer 'mArray[row]': Lines: 63, 65, 66, 67, 68, 67, 68, 
67, 68, 69, 74, 75, 76, 78, 79, 80, 78, 79, 80, 78, 79, 80, 78, 85, 86, 87, 89, 
91
1>e:\svn\spserver-read-only\spserver\spthreadpool.cpp(112): warning C6246: 
Local declaration of 'thread' hides declaration of the same name in outer 
scope. For additional information, see previous declaration at line '103' of 
'e:\svn\spserver-read-only\spserver\spthreadpool.cpp': Lines: 103
1>e:\svn\spserver-read-only\spserver\spthreadpool.cpp(113): warning C6011: 
Dereferencing NULL pointer 'thread': Lines: 100, 102, 103, 105, 107, 111, 112, 
113
1>e:\svn\spserver-read-only\spserver\sputils.cpp(39): warning C6308: 'realloc' 
might return null pointer: assigning null pointer to 'mFirst', which is passed 
as an argument to 'realloc', will cause the original memory block to be leaked
1>e:\svn\spserver-read-only\spserver\sputils.cpp(44): warning C6011: 
Dereferencing NULL pointer 'mFirst': Lines: 35, 37, 38, 39, 40, 41, 44
1>e:\svn\spserver-read-only\spserver\sputils.cpp(120): warning C6011: 
Dereferencing NULL pointer 'newEntries': Lines: 106, 107, 108, 110, 111, 114, 
115, 118, 119, 120
1>e:\svn\spserver-read-only\spserver\sputils.cpp(130): warning C6011: 
Dereferencing NULL pointer 'mEntries': Lines: 106, 107, 108, 110, 111, 114, 
115, 118, 119, 120, 123, 124, 126, 127, 130
1>e:\svn\spserver-read-only\spserver\sputils.cpp(237): warning C6328: 'char' 
passed as parameter '1' when 'unsigned char' is required in call to 'isspace'
1>e:\svn\spserver-read-only\spserver\sputils.cpp(239): warning C6328: 'const 
char' passed as parameter '1' when 'unsigned char' is required in call to 
'isspace'
1>e:\svn\spserver-read-only\spserver\sputils.cpp(243): warning C6328: 'const 
char' passed as parameter '1' when 'unsigned char' is required in call to 
'isspace'
1>e:\svn\spserver-read-only\spserver\sputils.cpp(251): warning C6328: 'const 
char' passed as parameter '1' when 'unsigned char' is required in call to 
'isspace'
1>e:\svn\spserver-read-only\spserver\sputils.cpp(259): warning C6328: 'const 
char' passed as parameter '1' when 'unsigned char' is required in call to 
'isspace'
1>e:\svn\spserver-read-only\spserver\sputils.cpp(272): warning C6328: 'const 
char' passed as parameter '1' when 'unsigned char' is required in call to 
'isspace'
1>e:\svn\spserver-read-only\spserver\sputils.cpp(283): warning C6328: 'char' 
passed as parameter '1' when 'unsigned char' is required in call to 'isspace'
1>e:\svn\spserver-read-only\spserver\spwin32port.cpp(151): warning C6053: Call 
to '_vsnprintf' might not zero-terminate string 'logTemp': Lines: 128, 129, 
130, 131, 133, 134, 135, 144, 146, 147, 148, 149, 151
1>e:\svn\spserver-read-only\spserver\spwin32port.cpp(284): warning C6031: 
Return value ignored: 'getchar'

I haven't run it on the other projects, but this may be worth checking out. 
Anyway keep up the good work guys :)

Original issue reported on code.google.com by j...@ethereality.co.za on 13 May 2011 at 1:44

GoogleCodeExporter commented 8 years ago
Thanks. I will remove these warning later.

Original comment by stephen....@gmail.com on 19 May 2011 at 2:40