]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
shrug
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 5 Apr 2007 22:31:47 +0000 (22:31 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 5 Apr 2007 22:31:47 +0000 (22:31 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4865 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/libdingaling/src/libdingaling.c

index a6e794a8fb86741216234e86a05bf10c2f667fad..0396b49fe6c69a306bee8537aa296cee21f6522f 100644 (file)
@@ -798,6 +798,7 @@ static ldl_avatar_t *ldl_get_avatar(ldl_handle_t *handle, char *path, char *from
        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 @@ static ldl_avatar_t *ldl_get_avatar(ldl_handle_t *handle, char *path, char *from
        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);