diff options
| author | beck <> | 2014-04-16 20:36:35 +0000 |
|---|---|---|
| committer | beck <> | 2014-04-16 20:36:35 +0000 |
| commit | 73c9e533da75d578dfa576ec1e77e6ad916c409f (patch) | |
| tree | 4a8d2bd6f2dd786d658a75ea2db858806f2ec5f4 /src/lib/libcrypto/x509/x509_obj.c | |
| parent | 8b189af5cdd592787ead69f8a0f378727a24b473 (diff) | |
| download | openbsd-73c9e533da75d578dfa576ec1e77e6ad916c409f.tar.gz openbsd-73c9e533da75d578dfa576ec1e77e6ad916c409f.tar.bz2 openbsd-73c9e533da75d578dfa576ec1e77e6ad916c409f.zip | |
Clean up dangerous strncpy use. This included a use where the resulting
string was potentially not nul terminated and a place where malloc return
was unchecked.
while we're at it remove dummytest.c
ok miod@
Diffstat (limited to 'src/lib/libcrypto/x509/x509_obj.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_obj.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_obj.c b/src/lib/libcrypto/x509/x509_obj.c index bcc1e7429e..1d3cf547d7 100644 --- a/src/lib/libcrypto/x509/x509_obj.c +++ b/src/lib/libcrypto/x509/x509_obj.c | |||
| @@ -90,8 +90,7 @@ int i; | |||
| 90 | buf=b->data; | 90 | buf=b->data; |
| 91 | OPENSSL_free(b); | 91 | OPENSSL_free(b); |
| 92 | } | 92 | } |
| 93 | strncpy(buf,"NO X509_NAME",len); | 93 | strlcpy(buf,"NO X509_NAME",len); |
| 94 | buf[len-1]='\0'; | ||
| 95 | return buf; | 94 | return buf; |
| 96 | } | 95 | } |
| 97 | 96 | ||
