Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.89 KB | None | 0 0
  1. diff --git a/src/htsmsg.c b/src/htsmsg.c
  2. index 52cd5ddd7..5c323e36b 100644
  3. --- a/src/htsmsg.c
  4. +++ b/src/htsmsg.c
  5. @@ -118,6 +118,7 @@ htsmsg_field_add(htsmsg_t *msg, const char *name, int type, int flags, size_t es
  6.    htsmsg_field_t *f;
  7.  
  8.    nsize = name ? strlen(name) + 1 : 1;
  9. +  nsize = (nsize + sizeof(int) - 1) & ~(sizeof(int) - 1);
  10.    f = malloc(sizeof(htsmsg_field_t) + nsize + esize);
  11.    if(f == NULL)
  12.      return NULL;
  13.  
  14.  
  15.  
  16. diff --git a/src/htsmsg_binary2.c b/src/htsmsg_binary2.c
  17. index a85aab81e..8c669f5a5 100644
  18. --- a/src/htsmsg_binary2.c
  19. +++ b/src/htsmsg_binary2.c
  20. @@ -114,6 +114,7 @@ htsmsg_binary2_des0(htsmsg_t *msg, const uint8_t *buf, uint32_t len)
  21.        return -1;
  22.  
  23.      nlen = namelen ? namelen + 1 : 1;
  24. +    nlen = (nlen + sizeof(int) - 1) & ~(sizeof(int) - 1);
  25.      tlen = sizeof(htsmsg_field_t) + nlen;
  26.      if (type == HMF_STR) {
  27.        tlen += datalen + 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement