Friday, 15 August 2014

c++ - security check when serializing in stream char* -


I have a logging macro that accepts a message and logic, say:

 < Code> int i = 5 LOG1 ("message", i);  

It will be logged in:

  message, i = 5  

To do this I get std :: Section and operator & lt; & Lt ;.

Now if I

  char * a = "foo"; LOG1 ("Message", A);  

The result is going to:

  message, a = foo  

The question is, what is a function Check the value of four * This stream operator & lt; & Lt; is safe to use, or potentially the attacks should be clearly checked ... a long string is occurring.


No comments:

Post a Comment