Skip to content

Commit

Permalink
Fixed bug with empty from header in message
Browse files Browse the repository at this point in the history
  • Loading branch information
axelsteiner committed Aug 11, 2021
1 parent 177dcfa commit 306afda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cmime_message.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* libcmime - A C mime library
* Copyright (C) 2013 SpaceNet AG and Axel Steiner <[email protected]>
* Copyright (C) 2021 SpaceNet AG and Axel Steiner <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -455,7 +455,11 @@ void cmime_message_set_sender(CMimeMessage_T *message, const char *sender) {
char *s = NULL;

assert(message);
assert(sender);
// fallback if sender is empty
if (sender == NULL) {
asprintf(&sender, "");
}

ca = cmime_address_parse_string(sender);
if (message->sender != NULL) {
cmime_address_free(message->sender);
Expand Down

0 comments on commit 306afda

Please sign in to comment.