It is useful to find issues in my code,especially for debugging the type of nullpoint errors.In my code ,I had forgotten to check my *p is null And it is dangerous and easy to coredump.when my program is running in different kinds of pc environment.
Code is here:
If (pNecessary==NUll)
{
Balabala….…..
Log(pNecessary->id); //CoreDump
}
//Then I add my checking before Log(pNecessary->id).However the SI_Scan still reported this issue.
Code modified:
If (pNecessary==NUll)||(xxxxxxxx)
{
Balabala….…..
If ((pNecessary!=NUll)
{
Log(pNecessary->id); //CoreDump
}
}
Last edit: Fanc 2014-12-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is useful to find issues in my code,especially for debugging the type of nullpoint errors.In my code ,I had forgotten to check my *p is null And it is dangerous and easy to coredump.when my program is running in different kinds of pc environment.
Code is here:
If (pNecessary==NUll)
{
Balabala….…..
Log(pNecessary->id); //CoreDump
}
//Then I add my checking before Log(pNecessary->id).However the SI_Scan still reported this issue.
Code modified:
If (pNecessary==NUll)||(xxxxxxxx)
{
Balabala….…..
If ((pNecessary!=NUll)
{
Log(pNecessary->id); //CoreDump
}
}
Last edit: Fanc 2014-12-25