Bug in libs/valuepair.c pairmake function
28 Jun
2006
28 Jun
'06
3:52 a.m.
Hi Alan and developers, I've found a small bug in libs/valuepair.c in the pairmake() function when trying to call pairmake on an attribute with a tag (eg tunnel attributes from dictionary.tunnel). For example pairmake("Tunnel-Preference:1", "1", T_OP_EQ) The code searches for a ":" in the attribute name which has been passed in, and if it finds a valid tag, sets the position of the ":" to 0 (a null). However, the attribute name is declared as a "const char *". I resolved the issue by doing a strdup on the attribute name to a local char * variable and then using that variable in the rest of the function. Making attribute non const doesn't seem like a good idea. cheers, Mike
7315
Age (days ago)
7315
Last active (days ago)
0 comments
1 participants
participants (1)
-
Mitchell, Michael J