diff --git a/src/nhttpd/yhttpd_core/ylogging.cpp b/src/nhttpd/yhttpd_core/ylogging.cpp index 2d93bc9e3..a61a863ff 100644 --- a/src/nhttpd/yhttpd_core/ylogging.cpp +++ b/src/nhttpd/yhttpd_core/ylogging.cpp @@ -77,7 +77,10 @@ void CLogging::printf(const char *fmt, ...) { va_end(arglist); pthread_mutex_lock(&Log_mutex); - ::printf(buffer); + buffer[bufferlen-1]='\0'; + ::printf("%s",buffer); + fflush(stdout); + if (LogToFile) { ; //FIXME Logging to File } diff --git a/src/nhttpd/yhttpd_mods/mod_auth.cpp b/src/nhttpd/yhttpd_mods/mod_auth.cpp index 8e747243c..89dc65f1b 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.cpp +++ b/src/nhttpd/yhttpd_mods/mod_auth.cpp @@ -65,6 +65,8 @@ bool CmAuth::CheckAuth(CyhookHandler *hh) { // decode Base64 buffer to String //----------------------------------------------------------------------------- std::string CmAuth::decodeBase64(const char *b64buffer) { + if(b64buffer==NULL) + return ""; char *newString; //shorter then b64buffer std::string result; if ((newString = (char *) malloc(sizeof(char) * strlen(b64buffer) + 1)) diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 3e2ba627e..3fd7a1c5e 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -330,8 +330,7 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh, if (ydebug) hh->printf("[ycgi debug]: CMD:[%s]
\n", ycmd.c_str()); yresult = YWeb_cgi_cmd(hh, ycmd); // 4. execute cmd -// log_level_printf(5, ": ycmd...:%s\n", ycmd.c_str());//FIXME %s %s ... segfault - + log_level_printf(5, ": ycmd...:%s\n", ycmd.c_str()); log_level_printf(6, ": yresult:%s\n", yresult.c_str()); if (ydebug) hh->printf("[ycgi debug]: RESULT:[%s]
\n",