mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
src/nhttpd: fix segfault if logging on
This commit is contained in:
@@ -77,7 +77,10 @@ void CLogging::printf(const char *fmt, ...) {
|
|||||||
va_end(arglist);
|
va_end(arglist);
|
||||||
|
|
||||||
pthread_mutex_lock(&Log_mutex);
|
pthread_mutex_lock(&Log_mutex);
|
||||||
::printf(buffer);
|
buffer[bufferlen-1]='\0';
|
||||||
|
::printf("%s",buffer);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
if (LogToFile) {
|
if (LogToFile) {
|
||||||
; //FIXME Logging to File
|
; //FIXME Logging to File
|
||||||
}
|
}
|
||||||
|
@@ -65,6 +65,8 @@ bool CmAuth::CheckAuth(CyhookHandler *hh) {
|
|||||||
// decode Base64 buffer to String
|
// decode Base64 buffer to String
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
std::string CmAuth::decodeBase64(const char *b64buffer) {
|
std::string CmAuth::decodeBase64(const char *b64buffer) {
|
||||||
|
if(b64buffer==NULL)
|
||||||
|
return "";
|
||||||
char *newString; //shorter then b64buffer
|
char *newString; //shorter then b64buffer
|
||||||
std::string result;
|
std::string result;
|
||||||
if ((newString = (char *) malloc(sizeof(char) * strlen(b64buffer) + 1))
|
if ((newString = (char *) malloc(sizeof(char) * strlen(b64buffer) + 1))
|
||||||
|
@@ -330,8 +330,7 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh,
|
|||||||
if (ydebug)
|
if (ydebug)
|
||||||
hh->printf("[ycgi debug]: CMD:[%s]<br/>\n", ycmd.c_str());
|
hh->printf("[ycgi debug]: CMD:[%s]<br/>\n", ycmd.c_str());
|
||||||
yresult = YWeb_cgi_cmd(hh, ycmd); // 4. execute cmd
|
yresult = YWeb_cgi_cmd(hh, ycmd); // 4. execute cmd
|
||||||
// log_level_printf(5, "<yLoop>: ycmd...:%s\n", ycmd.c_str());//FIXME <tr class="%ctimer"> <td>%s</td> <td>%s</td> ... segfault
|
log_level_printf(5, "<yLoop>: ycmd...:%s\n", ycmd.c_str());
|
||||||
|
|
||||||
log_level_printf(6, "<yLoop>: yresult:%s\n", yresult.c_str());
|
log_level_printf(6, "<yLoop>: yresult:%s\n", yresult.c_str());
|
||||||
if (ydebug)
|
if (ydebug)
|
||||||
hh->printf("[ycgi debug]: RESULT:[%s]<br/>\n",
|
hh->printf("[ycgi debug]: RESULT:[%s]<br/>\n",
|
||||||
|
Reference in New Issue
Block a user