From 81c7ed6d07d0ee4bfb70217de3e58ab5d54a6d86 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Thu, 6 Dec 2018 10:34:38 +0100 Subject: [PATCH] test/rpc_client: fix buffer overflow in the test pthread_join() expect pointer to 'void *' which is 8 byte long but gets pointer to 'int' which is 4 byte long. Bug introduced in: e6c30818e3d3 ("test: don't use bdev_svc application in this test") Fixes #533 Change-Id: Icaa35c5acec5ad9aebfb92e05b113c4275624db4 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/436309 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/rpc_client/rpc_client_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/rpc_client/rpc_client_test.c b/test/rpc_client/rpc_client_test.c index 68ca1f657..2f23d41e5 100644 --- a/test/rpc_client/rpc_client_test.c +++ b/test/rpc_client/rpc_client_test.c @@ -230,7 +230,7 @@ int main(int argc, char **argv) pthread_t srv_tid, client_tid; int srv_tid_valid; int client_tid_valid = -1; - int th_rc = INT_MIN; + intptr_t th_rc = INTPTR_MIN; int rc = 0, err_cnt = 0; sem_init(&g_rpc_server_th_listening, 0, 0); @@ -262,7 +262,7 @@ out: fprintf(stderr, "pthread_join() on cliennt thread failed (rc: %d)\n", rc); err_cnt++; } else if (th_rc) { - fprintf(stderr, "cliennt thread failed reported failure(thread rc: %d)\n", th_rc); + fprintf(stderr, "cliennt thread failed reported failure(thread rc: %d)\n", (int)th_rc); err_cnt++; } } @@ -281,7 +281,7 @@ out: fprintf(stderr, "pthread_join() on cliennt thread failed (rc: %d)\n", rc); err_cnt++; } else if (th_rc) { - fprintf(stderr, "cliennt thread failed reported failure(thread rc: %d)\n", th_rc); + fprintf(stderr, "cliennt thread failed reported failure(thread rc: %d)\n", (int)th_rc); err_cnt++; } }