Newer
Older
es->err_data[i]=data;
int i,n,s;
char *str,*p,*a;
Richard Levitte
committed
str=OPENSSL_malloc(s+1);
if (str == NULL) return;
str[0]='\0';
n=0;
for (i=0; i<num; i++)
{
/* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */
if (a != NULL)
n+=strlen(a);
if (n > s)
Richard Levitte
committed
p=OPENSSL_realloc(str,s+1);
if (p == NULL)
{
Richard Levitte
committed
OPENSSL_free(str);
Richard Levitte
committed
goto err;
}
else
str=p;
strcat(str,a);
}
}
ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
Richard Levitte
committed
err:
Richard Levitte
committed
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
int ERR_set_mark(void)
{
ERR_STATE *es;
es=ERR_get_state();
if (es->bottom == es->top) return 0;
es->err_flags[es->top]|=ERR_FLAG_MARK;
return 1;
}
int ERR_pop_to_mark(void)
{
ERR_STATE *es;
es=ERR_get_state();
while(es->bottom != es->top
&& (es->err_flags[es->top] & ERR_FLAG_MARK) == 0)
{
err_clear(es,es->top);
es->top-=1;
if (es->top == -1) es->top=ERR_NUM_ERRORS;
}
if (es->bottom == es->top) return 0;
es->err_flags[es->top]&=~ERR_FLAG_MARK;
return 1;
}