Changeset dacb555 for message.c


Ignore:
Timestamp:
Feb 9, 2010, 9:49:41 PM (11 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
a52eeb1
Parents:
d35d2ba
git-author:
Anders Kaseorg <andersk@mit.edu> (02/07/10 22:55:21)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/09/10 21:49:41)
Message:
zcrypt: Change zcrypt functions to allocate their output buffer.

The logic to determine the right buffer size is complicated and does
not belong in callers.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Nelson Elhage <nelhage@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    rd35d2ba rdacb555  
    841841  /* if zcrypt is enabled try to decrypt the message */
    842842  if (owl_global_is_zcrypt(&g) && !strcasecmp(n->z_opcode, "crypt")) {
    843     char *out;
    844     int ret;
    845 
    846     out=owl_malloc(strlen(owl_message_get_body(m))*16+20);
    847     ret=owl_zcrypt_decrypt(out, owl_message_get_body(m), owl_message_get_class(m), owl_message_get_instance(m));
    848     if (ret == 0)
     843    char *out = owl_zcrypt_decrypt(owl_message_get_body(m), owl_message_get_class(m), owl_message_get_instance(m));
     844    if (out) {
    849845      owl_message_set_body(m, out);
    850     owl_free(out);
     846      owl_free(out);
     847    }
    851848  }
    852849#endif 
Note: See TracChangeset for help on using the changeset viewer.