* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) Michael Haardt 2003 - 2015
- * Copyright (c) The Exim Maintainers 2016 - 2021
+/*
+ * Copyright (c) The Exim Maintainers 2016 - 2022
+ * Copyright (c) Michael Haardt 2003 - 2015
* See the file NOTICE for conditions of use and distribution.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/* This code was contributed by Michael Haardt. */
dst->length=0;
else
{
- dst->character = store_get(dst->length+1, is_tainted(src->character)); /* plus one for \0 */
+ dst->character = store_get(dst->length+1, src->character); /* plus one for \0 */
new=dst->character;
}
for (const uschar * start = src->character, * end = start + src->length;
{
gstring * g = string_catn(NULL, start, uri-start);
- to.character = string_from_gstring(g);
- to.length = g->ptr;
+ to.length = len_string_from_gstring(g, &to.character);
if (uri_decode(&to)==-1)
{
filter->errmsg=US"Invalid URI encoding";
return -1;
}
- new=store_get(sizeof(string_item), FALSE);
- new->text = store_get(to.length+1, is_tainted(to.character));
+ new = store_get(sizeof(string_item), GET_UNTAINTED);
+ new->text = store_get(to.length+1, to.character);
if (to.length) memcpy(new->text, to.character, to.length);
- new->text[to.length]='\0';
- new->next=*recipient;
- *recipient=new;
+ new->text[to.length] = '\0';
+ new->next = *recipient;
+ *recipient = new;
}
else
{
- filter->errmsg=US"Missing addr-spec in URI";
+ filter->errmsg = US"Missing addr-spec in URI";
return -1;
}
if (*uri=='%') uri+=3;
{
gstring * g = string_catn(NULL, start, uri-start);
- hname.character = string_from_gstring(g);
- hname.length = g->ptr;
+ hname.length = len_string_from_gstring(g, &hname.character);
if (uri_decode(&hname)==-1)
{
filter->errmsg=US"Invalid URI encoding";
{
gstring * g = string_catn(NULL, start, uri-start);
- hname.character = string_from_gstring(g);
- hname.length = g->ptr;
+ hname.length = len_string_from_gstring(g, &hname.character);
if (uri_decode(&hvalue)==-1)
{
filter->errmsg=US"Invalid URI encoding";
}
if (hname.length==2 && strcmpic(hname.character, US"to")==0)
{
- new=store_get(sizeof(string_item), FALSE);
- new->text = store_get(hvalue.length+1, is_tainted(hvalue.character));
+ new=store_get(sizeof(string_item), GET_UNTAINTED);
+ new->text = store_get(hvalue.length+1, hvalue.character);
if (hvalue.length) memcpy(new->text, hvalue.character, hvalue.length);
new->text[hvalue.length]='\0';
new->next=*recipient;
g = string_catn(g, hvalue.character, hvalue.length);
g = string_catn(g, CUS "\n", 1);
- header->character = string_from_gstring(g);
- header->length = g->ptr;
+ hname.length = len_string_from_gstring(g, &hname.character);
}
}
if (*uri=='&') ++uri;
++filter->pc;
if (g)
- {
- data->character = string_from_gstring(g);
- data->length = g->ptr;
- }
+ data->length = len_string_from_gstring(g, &data->character);
else
data->character = US"\0";
/* that way, there will be at least one character allocated */
#endif
{
if (g)
- {
- data->character = string_from_gstring(g);
- data->length = g->ptr;
- }
+ data->length = len_string_from_gstring(g, &data->character);
else
data->character = US"\0";
/* that way, there will be at least one character allocated */
struct String *new;
dataCapacity = dataCapacity ? dataCapacity * 2 : 4;
- new = store_get(sizeof(struct String) * dataCapacity, FALSE);
+ new = store_get(sizeof(struct String) * dataCapacity, GET_UNTAINTED);
if (d) memcpy(new,d,sizeof(struct String)*dataLength);
d = new;
}
else /* single string */
{
- if (!(d=store_get(sizeof(struct String)*2, FALSE)))
+ if (!(d=store_get(sizeof(struct String)*2, GET_UNTAINTED)))
return -1;
m=parse_string(filter,&d[0]);
if (!already)
/* New notification, process it */
{
- struct Notification * sent = store_get(sizeof(struct Notification), FALSE);
+ struct Notification * sent = store_get(sizeof(struct Notification), GET_UNTAINTED);
sent->method=method;
sent->importance=importance;
sent->message=message;
}
for (struct String * a = addresses; a->length != -1; ++a)
{
- string_item * new = store_get(sizeof(string_item), FALSE);
+ string_item * new = store_get(sizeof(string_item), GET_UNTAINTED);
- new->text = store_get(a->length+1, is_tainted(a->character));
+ new->text = store_get(a->length+1, a->character);
if (a->length) memcpy(new->text,a->character,a->length);
new->text[a->length]='\0';
new->next=aliases;
if (subject.length==-1)
{
- uschar *subject_def;
+ uschar * subject_def;
subject_def = expand_string(US"${if def:header_subject {true}{false}}");
if (subject_def && Ustrcmp(subject_def,"true")==0)
expand_header(&subject,&str_subject);
g = string_catn(g, subject.character, subject.length);
- subject.character = string_from_gstring(g);
- subject.length = g->ptr;
+ subject.length = len_string_from_gstring(g, &subject.character);
}
else
{
- subject.character=US"Automated reply";
- subject.length=Ustrlen(subject.character);
+ subject.character = US"Automated reply";
+ subject.length = Ustrlen(subject.character);
}
}
addr->prop.ignore_error = TRUE;
addr->next = *generated;
*generated = addr;
- addr->reply = store_get(sizeof(reply_item), FALSE);
+ addr->reply = store_get(sizeof(reply_item), GET_UNTAINTED);
memset(addr->reply,0,sizeof(reply_item)); /* XXX */
addr->reply->to = string_copy(sender_address);
if (from.length==-1)