void ERR_add_error_vdata(int num, va_list args) { int i, n, s; char *str, *p, *a; s = 80; str = OPENSSL_malloc(s + 1); if (str == NULL) return; str[0] = '\0'; n = 0; for (i = 0; i < num; i++) { a = va_arg(args, char *); /* ignore NULLs, thanks to Bob Beck <*****@*****.**> */ if (a != NULL) { n += strlen(a); if (n > s) { s = n + 20; p = OPENSSL_realloc(str, s + 1); if (p == NULL) { OPENSSL_free(str); return; } str = p; } OPENSSL_strlcat(str, a, (size_t)s + 1); } } ERR_set_error_data(str, ERR_TXT_MALLOCED | ERR_TXT_STRING); }
void ERR_add_error_vdata(int num, va_list args) { int i, n, s; char *str, *p, *a; s = 80; str = OPENSSL_malloc(s + 1); if (str == NULL) return; str[0] = '\0'; n = 0; for (i = 0; i < num; i++) { a = va_arg(args, char *); if (a == NULL) a = "<NULL>"; n += strlen(a); if (n > s) { s = n + 20; p = OPENSSL_realloc(str, s + 1); if (p == NULL) { OPENSSL_free(str); return; } str = p; } OPENSSL_strlcat(str, a, (size_t)s + 1); } ERR_set_error_data(str, ERR_TXT_MALLOCED | ERR_TXT_STRING); }
/* Add EFIAPI for UEFI version. */ void #if defined(OPENSSL_SYS_UEFI) EFIAPI #endif ERR_add_error_data(int num, ...) { va_list args; int i,n,s; char *str,*p,*a; s=80; str=OPENSSL_malloc(s+1); if (str == NULL) return; str[0]='\0'; va_start(args, num); n=0; for (i=0; i<num; i++) { a=va_arg(args, char*); /* ignore NULLs, thanks to Bob Beck <*****@*****.**> */ if (a != NULL) { n+=strlen(a); if (n > s) { s=n+20; p=OPENSSL_realloc(str,s+1); if (p == NULL) { OPENSSL_free(str); goto err; } else str=p; } BUF_strlcat(str,a,(size_t)s+1); } } ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); err: va_end(args); }
void ERR_add_error_data(int num, ...) { va_list args; int i,n,s; char *str,*p,*a; s=64; str=Malloc(s+1); if (str == NULL) return; str[0]='\0'; va_start(args, num); n=0; for (i=0; i<num; i++) { a=va_arg(args, char*); /* ignore NULLs, thanks to Bob Beck <*****@*****.**> */ if (a != NULL) { n+=strlen(a); if (n > s) { s=n+20; p=Realloc(str,s+1); if (p == NULL) { Free(str); return; } else str=p; } strcat(str,a); } } ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); va_end(args); }