On 16.09.10 17:00, Антон Загорский wrote:
Also, a note about core/sipctrl/sip_parser.cpp:int parse_sip_msg() There are a lot of assignment like err_msg = (char *)"blablabla" where err_msg is a function parameter char *&. But that will assignment to err_msg a local pointer and outside of parse_sip_msg() this pointer will be invalid. Right decisions are: 1) use string (safe, a bit slowly) 2) use strcpy_s (unsafe, fast)
In fact, this is quite safe because string literals have to be stored statically (in the data segment of the program), which is also why you cannot change those data (read-only marked segment). As the messages are not changed afterwards, but just printed, it does not matter at all.
Here is a better explaination: http://stackoverflow.com/questions/267114/scope-of-string-literals Cheers Raphael. _______________________________________________ Sems mailing list [email protected] http://lists.iptel.org/mailman/listinfo/sems
