LP1830642 Remove variable args from md5sum()
authorBill Erickson <berickxx@gmail.com>
Wed, 29 May 2019 16:36:24 +0000 (12:36 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 1 Oct 2019 19:33:30 +0000 (15:33 -0400)
Remove support for passing variable args to the md5sum() function, since
no code currently uses this, and it causes problems processing strings
with '%' characters.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

include/opensrf/utils.h
src/libopensrf/utils.c

index 34e0ba6..f9e156c 100644 (file)
@@ -367,7 +367,7 @@ int stringisnum(const char* s);
        Calculates the md5 of the text provided.
        The returned string must be freed by the caller.
 */
-char* md5sum( const char* text, ... );
+char* md5sum( const char* text );
 
 
 /*
index 2698f1d..6b1d9aa 100644 (file)
@@ -732,18 +732,16 @@ int stringisnum(const char* s) {
        This function is a wrapper for some public domain routines written by David Madore,
        Ron Rivest, and Colin Plumb.
 */
-char* md5sum( const char* text, ... ) {
+char* md5sum( const char* text ) {
 
        struct md5_ctx ctx;
        unsigned char digest[16];
 
        MD5_start (&ctx);
 
-       VA_LIST_TO_STRING(text);
-
        int i;
-       for ( i=0 ; i != strlen(VA_BUF) ; i++ )
-               MD5_feed (&ctx, VA_BUF[i]);
+       for ( i=0 ; i != strlen(text) ; i++ )
+               MD5_feed (&ctx, text[i]);
 
        MD5_stop (&ctx, digest);