git://scientific.zcu.cz
/
jra1mw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2d2c71
)
SIGSEGV happened if htproxyput was run by non-root user, checked fopen and fdopen...
author
Marcel Poul
<marcel.poul@cern.ch>
Sat, 10 Nov 2012 15:14:01 +0000
(15:14 +0000)
committer
Marcel Poul
<marcel.poul@cern.ch>
Sat, 10 Nov 2012 15:14:01 +0000
(15:14 +0000)
org.gridsite.core/src/htproxyput.c
patch
|
blob
|
blame
|
history
diff --git
a/org.gridsite.core/src/htproxyput.c
b/org.gridsite.core/src/htproxyput.c
index
031a502
..
64a9bdb
100644
(file)
--- a/
org.gridsite.core/src/htproxyput.c
+++ b/
org.gridsite.core/src/htproxyput.c
@@
-265,12
+265,25
@@
int main(int argc, char *argv[])
fd = mkstemp(keycert);
ofp = fdopen(fd, "w");
+ if (!ofp)
+ {
+ printf(stderr, "Cannot open tmp file for the key\n");
+ return 1;
+ }
ifp = fopen(key, "r");
+ {
+ printf(stderr, "Cannot open the file with the key\n");
+ return 1;
+ }
while ((c = fgetc(ifp)) != EOF) fputc(c, ofp);
fclose(ifp);
ifp = fopen(cert, "r");
+ {
+ printf(stderr, "Cannot open the file with the cert\n");
+ return 1;
+ }
while ((c = fgetc(ifp)) != EOF) fputc(c, ofp);
fclose(ifp);