Fix more error codes.
[oweals/openssl.git] / crypto / x509 / x509_obj.c
index 6a3ba8eb154322c11965af2ac8af49c4f91d9675..1e718f76eb2dd0b37582e22110f7b002db2512d9 100644 (file)
@@ -94,6 +94,7 @@ int i;
                OPENSSL_free(b);
                }
            strncpy(buf,"NO X509_NAME",len);
+           buf[len-1]='\0';
            return buf;
            }
 
@@ -214,6 +215,8 @@ int i;
                }
        else
                p=buf;
+       if (i == 0)
+               *p = '\0';
        return(p);
 err:
        X509err(X509_F_X509_NAME_ONELINE,ERR_R_MALLOC_FAILURE);