diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2014-10-07 14:52:53 -0400 |
---|---|---|
committer | Abhishek Koneru <akoneru@redhat.com> | 2014-10-09 15:03:06 -0400 |
commit | 72bad14bb14e16455874fd8c38913a7ccca407e2 (patch) | |
tree | 84eb74dc12b4b7423f33154c78293c54194de82a /base/native-tools | |
parent | 821a35fc5ce58cda0816c564dfaa0df2d383f81e (diff) | |
download | pki-72bad14bb14e16455874fd8c38913a7ccca407e2.tar.gz pki-72bad14bb14e16455874fd8c38913a7ccca407e2.tar.xz pki-72bad14bb14e16455874fd8c38913a7ccca407e2.zip |
Fixing upstream trac ticket 1150.
In both sslget.c and revoker.c there is an incorrect equality
check which compares the output of a comparision operator with
a constant(SECFailure) which has a value of -1. The fix will print
the correct SECFailure or SECSuccess value for the do_writes method.
Diffstat (limited to 'base/native-tools')
-rw-r--r-- | base/native-tools/src/revoker/revoker.c | 6 | ||||
-rw-r--r-- | base/native-tools/src/sslget/sslget.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/base/native-tools/src/revoker/revoker.c b/base/native-tools/src/revoker/revoker.c index c7fc76294..f0ee18393 100644 --- a/base/native-tools/src/revoker/revoker.c +++ b/base/native-tools/src/revoker/revoker.c @@ -325,6 +325,7 @@ do_writes( PRFileDesc * ssl_sock = (PRFileDesc *)a; PRUint32 sent = 0; PRInt32 count = 0; + PRInt32 result = 0; while (sent < bigBuf.len) { @@ -343,9 +344,10 @@ do_writes( FPRINTF(stderr, "do_writes shutting down send socket\n"); /* PR_Shutdown(ssl_sock, PR_SHUTDOWN_SEND); */ } + result = (sent < bigBuf.len) ? SECFailure : SECSuccess; - FPRINTF(stderr, "do_writes exiting with (failure = %d)\n",sent<bigBuf.len == SECFailure); - return (sent < bigBuf.len) ? SECFailure : SECSuccess; + FPRINTF(stderr, "do_writes exiting with (result = %d)\n", result); + return result; } diff --git a/base/native-tools/src/sslget/sslget.c b/base/native-tools/src/sslget/sslget.c index cfd806785..c453096ba 100644 --- a/base/native-tools/src/sslget/sslget.c +++ b/base/native-tools/src/sslget/sslget.c @@ -316,6 +316,7 @@ do_writes( PRFileDesc * ssl_sock = (PRFileDesc *)a; PRUint32 sent = 0; PRInt32 count = 0; + PRInt32 result = 0; while (sent < bigBuf.len) { @@ -334,9 +335,10 @@ do_writes( FPRINTF(stderr, "do_writes shutting down send socket\n"); /* PR_Shutdown(ssl_sock, PR_SHUTDOWN_SEND); */ } + result = (sent < bigBuf.len) ? SECFailure : SECSuccess; - FPRINTF(stderr, "do_writes exiting with (failure = %d)\n",sent<bigBuf.len == SECFailure); - return (sent < bigBuf.len) ? SECFailure : SECSuccess; + FPRINTF(stderr, "do_writes exiting with (result = %d)\n", result); + return result; } |