forked from spmfilter/libcmime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug with empty from header in message
- Loading branch information
1 parent
177dcfa
commit 306afda
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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); | ||
|