projects
/
platform
/
upstream
/
freerdp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
acc9638
)
Fixed data replace.
author
Armin Novak
<armin.novak@thincast.com>
Thu, 11 Jun 2015 07:23:32 +0000
(09:23 +0200)
committer
Armin Novak
<armin.novak@thincast.com>
Thu, 11 Jun 2015 07:24:53 +0000
(09:24 +0200)
libfreerdp/crypto/certificate.c
patch
|
blob
|
history
diff --git
a/libfreerdp/crypto/certificate.c
b/libfreerdp/crypto/certificate.c
index
2d64a05
..
98090b4
100644
(file)
--- a/
libfreerdp/crypto/certificate.c
+++ b/
libfreerdp/crypto/certificate.c
@@
-300,7
+300,7
@@
BOOL certificate_data_replace(rdpCertificateStore* certificate_store, rdpCertifi
char* pline;
long int size;
- fp = fopen(certificate_store->file, "
wb+
");
+ fp = fopen(certificate_store->file, "
rb
");
if (!fp)
return FALSE;
@@
-330,6
+330,16
@@
BOOL certificate_data_replace(rdpCertificateStore* certificate_store, rdpCertifi
return FALSE;
}
+ fclose(fp);
+
+ fp = fopen(certificate_store->file, "wb+");
+
+ if (!fp)
+ {
+ free(data);
+ return FALSE;
+ }
+
/* Write the file back out, with appropriate fingerprint substitutions */
data[size] = '\n';
data[size + 1] = '\0';