Some test cases were causing library code to be run with invalid
parameters. Reject these cases.
*/
void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
{
- if (!actx)
+ if (!actx || !attach)
return;
if (actx->idxlen == actx->idxmax)
*/
void mutt_actx_add_fp(struct AttachCtx *actx, FILE *fp_new)
{
- if (!actx)
+ if (!actx || !fp_new)
return;
if (actx->fp_len == actx->fp_max)
*/
void mutt_actx_add_body(struct AttachCtx *actx, struct Body *new_body)
{
- if (!actx)
+ if (!actx || !new_body)
return;
if (actx->body_len == actx->body_max)
*/
void mutt_auto_subscribe(const char *mailto)
{
+ if (!mailto)
+ return;
+
if (!AutoSubscribeCache)
AutoSubscribeCache = mutt_hash_new(200, MUTT_HASH_STRCASECMP | MUTT_HASH_STRDUP_KEYS);
FREE(&l->regex.pattern);
if (l->regex.regex)
regfree(l->regex.regex);
+ FREE(&l->regex.regex);
FREE(&l->regex);
FREE(&l);
}
char *mutt_ch_choose(const char *fromcode, const char *charsets, const char *u,
size_t ulen, char **d, size_t *dlen)
{
+ if (!fromcode)
+ return NULL;
+
char *e = NULL, *tocode = NULL;
size_t elen = 0, bestn = 0;
const char *q = NULL;