diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 71a067cd9..aae302ccf 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -492,7 +492,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne // open file for write int fd = open(upload_filename.c_str(), O_WRONLY|O_CREAT|O_TRUNC); - if (fd<=0) + if (fd<0) { aprintf("cannot open file %s: ", upload_filename.c_str()); dperror(""); diff --git a/src/nhttpd/yhttpd_core/ysocket.cpp b/src/nhttpd/yhttpd_core/ysocket.cpp index 3ff1aa675..0d8ef6d74 100644 --- a/src/nhttpd/yhttpd_core/ysocket.cpp +++ b/src/nhttpd/yhttpd_core/ysocket.cpp @@ -309,7 +309,7 @@ int CySocket::Send(char const *buffer, unsigned int length) //----------------------------------------------------------------------------- bool CySocket::CheckSocketOpen() { - char buffer[32]; + char buffer[32]={0}; #ifdef CONFIG_SYSTEM_CYGWIN return !(recv(sock, buffer, sizeof(buffer), MSG_PEEK | MSG_NOSIGNAL) == 0);