Browse Source

more asserts

doc_update_sequoia
vb 8 years ago
parent
commit
254b93a1ba
6 changed files with 12 additions and 3 deletions
  1. +2
    -0
      src/message.c
  2. +1
    -0
      src/message_api.c
  3. +2
    -1
      src/pEpEngine.c
  4. +1
    -2
      src/pgp_gpg.c
  5. +3
    -0
      src/stringlist.c
  6. +3
    -0
      src/stringpair.c

+ 2
- 0
src/message.c View File

@ -119,6 +119,7 @@ DYNAMIC_API message * message_dup(const message *src)
if (src->sent) {
msg->sent = malloc(sizeof(timestamp));
assert(msg->sent);
if (msg->sent == NULL)
goto enomem;
memcpy(msg->sent, src->sent, sizeof(timestamp));
@ -126,6 +127,7 @@ DYNAMIC_API message * message_dup(const message *src)
if (src->recv) {
msg->recv = malloc(sizeof(timestamp));
assert(msg->recv);
if (msg->recv == NULL)
goto enomem;
memcpy(msg->recv, src->recv, sizeof(timestamp));


+ 1
- 0
src/message_api.c View File

@ -24,6 +24,7 @@ static char * combine_short_and_long(const char *shortmsg, const char *longmsg)
longmsg = "";
ptext = calloc(1, strlen(shortmsg) + strlen(longmsg) + 12);
assert(ptext);
if (ptext == NULL)
return NULL;


+ 2
- 1
src/pEpEngine.c View File

@ -376,7 +376,7 @@ DYNAMIC_API PEP_STATUS safewords(
)
{
const char *source = fingerprint;
char *buffer = calloc(1, MAX_SAFEWORDS_SPACE);
char *buffer;
char *dest = buffer;
size_t fsize;
PEP_STATUS _status;
@ -390,6 +390,7 @@ DYNAMIC_API PEP_STATUS safewords(
*words = NULL;
*wsize = 0;
buffer = calloc(1, MAX_SAFEWORDS_SPACE);
assert(buffer);
if (buffer == NULL)
return PEP_OUT_OF_MEMORY;


+ 1
- 2
src/pgp_gpg.c View File

@ -684,8 +684,7 @@ PEP_STATUS pgp_encrypt_and_sign(
return PEP_UNKNOWN_ERROR;
}
rcpt = calloc(stringlist_length(keylist) + 1,
sizeof(gpgme_key_t));
rcpt = calloc(stringlist_length(keylist) + 1, sizeof(gpgme_key_t));
assert(rcpt);
if (rcpt == NULL) {
gpg.gpgme_data_release(plain);


+ 3
- 0
src/stringlist.c View File

@ -8,6 +8,8 @@
DYNAMIC_API stringlist_t *new_stringlist(const char *value)
{
stringlist_t *result = calloc(1, sizeof(stringlist_t));
assert(result);
if (result && value) {
result->value = strdup(value);
assert(result->value);
@ -16,6 +18,7 @@ DYNAMIC_API stringlist_t *new_stringlist(const char *value)
return NULL;
}
}
return result;
}


+ 3
- 0
src/stringpair.c View File

@ -51,6 +51,8 @@ DYNAMIC_API stringpair_t * stringpair_dup(const stringpair_t *src)
DYNAMIC_API stringpair_list_t *new_stringpair_list(const stringpair_t *value)
{
stringpair_list_t *result = calloc(1, sizeof(stringpair_list_t));
assert(result);
if (result && value) {
result->value = stringpair_dup(value);
if (result->value == 0) {
@ -58,6 +60,7 @@ DYNAMIC_API stringpair_list_t *new_stringpair_list(const stringpair_t *value)
return NULL;
}
}
return result;
}


Loading…
Cancel
Save