Commit 81c7ed6d authored by Pawel Wodkowski's avatar Pawel Wodkowski Committed by Jim Harris
Browse files

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:
e6c30818 ("test: don't use bdev_svc application in this test")

Fixes #533

Change-Id: Icaa35c5acec5ad9aebfb92e05b113c4275624db4
Signed-off-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/436309


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent a207f575
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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++;
		}
	}