[asterisk-dev] [Code Review] base64 unit test

David Chappell chappell at mouse.trincoll.edu
Fri Feb 26 21:21:45 CST 2010


> I noticed that the test was failing because the ast_base64decoded wasn't terminating the buffer with a '\0'.  This almost looked intentional, but I don't understand why we would want it to work like this so I fixed it.
>   

It was intentional.  The patch in bug 10979 was the previous attempt to 
make ast_base64decode null-terminate the output string.  It was reverted 
because it broke RSA authentication.  As I recall, it replaced the last 
type of an encryption key with zero.  It was decided that 
null-terminating the output of ast_base64decode didn't really make sense.

It looks like your patch may avoid this pitfall into which the last one 
fell since it seems to null-terminate the output only if there is at 
least one byte of space in the output buffer.




More information about the asterisk-dev mailing list