CWARN.PASSBYVALUE.EXCException object passed by value is too largeThe CWARN.PASSBYVALUE.EXC checker finds instances in which an exception object passed by value is too large. Vulnerability and riskPassing by value is not necessarily an error, but it can cause a performance loss because of the amount of data copied. Vulnerable code example1 struct big_exc { 2 char str[111]; 3 }; 4 5 void foo() { 6 try 7 { 8 /*...*/ 9 } 10 catch(big_exc be) 11 { 12 /*...*/ 13 } 14 } Klocwork flags line 10, in which the exception object 'be' is too large. Related checkersSecurity Guidelines |