Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/x509/clu_x509_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Copyright (C) 2006-2025 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
Expand Down Expand Up @@ -1061,7 +1060,7 @@ int wolfCLU_CertSignSetOut(WOLFCLU_CERT_SIGN* csign, char* out)
int wolfCLU_CertSignAppendOut(WOLFCLU_CERT_SIGN* csign, char* out)
{
int ret = WOLFCLU_SUCCESS;
int outSz;
int outSz = 0;
char* s = NULL;

if (csign == NULL) {
Expand All @@ -1071,6 +1070,13 @@ int wolfCLU_CertSignAppendOut(WOLFCLU_CERT_SIGN* csign, char* out)
if (ret == WOLFCLU_SUCCESS && out != NULL) {
outSz = (int)XSTRLEN(out);
}
/* case where outDir is set to an empty string we want to treat it as
* a null pointer in the rest of the function logic so free it
* then set it to a null ptr.*/
if (ret == WOLFCLU_SUCCESS && csign->outDir != NULL
&& csign->outDir[0] == '\0') {
ret = wolfCLU_CertSignSetOut(csign, NULL);
}

/* case 1 where no dir is set and just using 'out' */
if (ret == WOLFCLU_SUCCESS && csign->outDir == NULL && out != NULL) {
Expand Down
Loading