libaacs | branch: master | npzacs <[email protected]> | Tue Nov  9 16:57:45 2010 
+0200| [56a452e85e2075b89dcfe98da503043a50184add] | committer: npzacs 

mmc_open(): malloc --> calloc
Make sure all fields are initialized even if some parameters are not given

> http://git.videolan.org/gitweb.cgi/libaacs.git/?a=commit;h=56a452e85e2075b89dcfe98da503043a50184add
---

 src/libaacs/mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/libaacs/mmc.c b/src/libaacs/mmc.c
index c4d3dab..1ccd263 100644
--- a/src/libaacs/mmc.c
+++ b/src/libaacs/mmc.c
@@ -358,7 +358,7 @@ MMC *mmc_open(const char *path, const uint8_t 
*host_priv_key,
               const uint8_t *host_cert, const uint8_t *host_nonce,
               const uint8_t *host_key_point)
 {
-    MMC *mmc = malloc(sizeof(MMC));
+    MMC *mmc = calloc(1, sizeof(MMC));
 
     if (host_priv_key) memcpy(mmc->host_priv_key, host_priv_key, 20);
     if (host_cert) memcpy(mmc->host_cert, host_cert, 92);

_______________________________________________
libaacs-devel mailing list
[email protected]
http://mailman.videolan.org/listinfo/libaacs-devel

Reply via email to