From: RĂ©mi Duraffort Date: Sun, 28 Mar 2010 15:50:35 +0000 (+0200) Subject: Growl: fix bad memset. X-Git-Tag: 1.1.0-pre1~289 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7b7d26d88a500582c22f47a8c5e6d001967dd491;p=vlc Growl: fix bad memset. --- diff --git a/modules/misc/notify/growl_udp.c b/modules/misc/notify/growl_udp.c index b43f27593d..72764be2f3 100644 --- a/modules/misc/notify/growl_udp.c +++ b/modules/misc/notify/growl_udp.c @@ -180,7 +180,7 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var, *****************************************************************************/ static int RegisterToGrowl( vlc_object_t *p_this ) { - uint8_t *psz_encoded = malloc(100); + uint8_t *psz_encoded = calloc( 100, 1 ); uint8_t i_defaults = 0; static const char *psz_notifications[] = {"Now Playing", NULL}; bool pb_defaults[] = {true, false}; @@ -188,7 +188,6 @@ static int RegisterToGrowl( vlc_object_t *p_this ) if( psz_encoded == NULL ) return false; - memset( psz_encoded, 0, sizeof(psz_encoded) ); psz_encoded[i++] = GROWL_PROTOCOL_VERSION; psz_encoded[i++] = GROWL_TYPE_REGISTRATION; insertstrlen(APPLICATION_NAME); @@ -220,13 +219,12 @@ static int RegisterToGrowl( vlc_object_t *p_this ) static int NotifyToGrowl( vlc_object_t *p_this, const char *psz_desc ) { const char *psz_type = "Now Playing", *psz_title = "Now Playing"; - uint8_t *psz_encoded = malloc(GROWL_MAX_LENGTH + 42); + uint8_t *psz_encoded = calloc(GROWL_MAX_LENGTH + 42, 1); uint16_t flags; int i = 0; if( psz_encoded == NULL ) return false; - memset( psz_encoded, 0, sizeof(psz_encoded) ); psz_encoded[i++] = GROWL_PROTOCOL_VERSION; psz_encoded[i++] = GROWL_TYPE_NOTIFICATION; flags = 0;