From 287467b81b17bf0e69e1b927a495fa99b5f9ac17 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Wed, 14 Sep 2022 16:50:38 +0800 Subject: [PATCH] netdb: Add return check in rexec_af Signed-off-by: anjiahao --- libs/libc/netdb/lib_rexec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/libc/netdb/lib_rexec.c b/libs/libc/netdb/lib_rexec.c index 2ceed200dd..00f69ce369 100644 --- a/libs/libc/netdb/lib_rexec.c +++ b/libs/libc/netdb/lib_rexec.c @@ -110,7 +110,11 @@ int rexec_af(FAR char **ahost, int inport, FAR const char *user, /* ignore second connection(fd2p always is NULL) */ - write(sock, "", 1); + ret = write(sock, "", 1); + if (ret < 0) + { + goto conn_out; + } /* Send username */