[Freeswitch-svn] [commit] r4865 - freeswitch/trunk/libs/libdingaling/src

Freeswitch SVN anthm at freeswitch.org
Thu Apr 5 18:31:47 EDT 2007


Author: anthm
Date: Thu Apr  5 18:31:47 2007
New Revision: 4865

Modified:
   freeswitch/trunk/libs/libdingaling/src/libdingaling.c

Log:
shrug

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c	Thu Apr  5 18:31:47 2007
@@ -798,6 +798,7 @@
 	int fd = -1;
 	size_t bytes;
 	char *key;
+	char hash[128] = "";
 
 	if (from && (ap = (ldl_avatar_t *) apr_hash_get(globals.avatar_hash, from, APR_HASH_KEY_STRING))) {
 		return ap;
@@ -828,7 +829,8 @@
 	ap = malloc(sizeof(*ap));
 	assert(ap != NULL);
 	memset(ap, 0, sizeof(*ap));
-	sha1_hash(ap->hash, (char *)image, bytes);
+	ldl_random_string(hash, sizeof(hash) -1, NULL);
+	sha1_hash(ap->hash, hash, strlen(hash));
 	ap->path = strdup(path);
 
 	key = ldl_handle_strdup(handle, from);



More information about the Freeswitch-svn mailing list