[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] engine/core core_proc.cpp,1.115.4.4,1.115.4.5
From:       yijil () helixcommunity ! org
Date:       2013-06-27 2:41:12
[Download RAW message or body]

Update of /cvsroot/server/engine/core
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv25634

Modified Files:
      Tag: SERVER_15_1_0
	core_proc.cpp 
Log Message:
Committed to: HEAD, SERVER_15_1_0_RN

Reviewed by: Richard

Synopsis
========
HLXSRV-464  [Vhost]Server crash caused by a redundant '<' code that in 'rmvhost.cfg' \
configuration file.

Branches: HEAD, SERVER_15_1_0_RN

Reviewer: Anyone

Description
===========
 Repro:
 1.Add a code like '<' in rmvhost.cfg file:
 <!-- M3U File Generator -->
 <List Name="M3U File Generator">
 <Var ShortName="hx-m3ugen"/>
 <
 <Var MountPoint="/m3ugen/"/>
 </List>
 2.Restart server

ROOT CAUSE:
When configure file like given before, fetch mount point for m3ugen will failed. But \
code not check whether it is NULL, so CA.

MY FIX:
Check whether mount point exists.

Files Affected
==============
server/engine/core/core_proc.cpp

Testing Performed
=================
Integration Tests




Index: core_proc.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/core_proc.cpp,v
retrieving revision 1.115.4.4
retrieving revision 1.115.4.5
diff -u -d -r1.115.4.4 -r1.115.4.5
--- core_proc.cpp	26 Jun 2013 10:09:48 -0000	1.115.4.4
+++ core_proc.cpp	27 Jun 2013 02:41:04 -0000	1.115.4.5
@@ -624,29 +624,33 @@
                     res = hxreg->GetStrByName(pMountpointStr, pBuffer);
                     
                     //Make sure that MP has a slash at the start and end
-                    char szMP[256]= {0};
-                    UCHAR* pStr = pBuffer->GetBuffer();
-
-                    int i = 0;
-                    if (*pStr != '/')
-                    {
-                        szMP[i++] = '/';
-                    }
-                    while(pStr && *pStr != '\0')
-                    {
-                        szMP[i] = *pStr;
-                        i++;
-                        pStr++;
-                    }
-                    if (*(pStr - 1) != '/')
+                    if (SUCCEEDED(res) && pBuffer)
                     {
-                        szMP[i] = '/';
-                        i++;
-                    }
-                    szMP[i] = '\0';
+                        char szMP[256]= {0};
+                        UCHAR* pStr = pBuffer->GetBuffer();
 
-                    pMountpoint = new_string(szMP);
-                    HX_RELEASE(pBuffer);
+                        int i = 0;
+                        if (*pStr != '/')
+                        {
+                            szMP[i++] = '/';
+                        }
+                        while(pStr && *pStr != '\0')
+                        {
+                            szMP[i] = *pStr;
+                            i++;
+                            pStr++;
+                        }
+                        if (*(pStr - 1) != '/')
+                        {
+                            szMP[i] = '/';
+                            i++;
+                        }
+                        szMP[i] = '\0';
+
+                        pMountpoint = new_string(szMP);
+                        HX_RELEASE(pBuffer);
+                    }
+                    
                     break;
                 }
                 HX_RELEASE(pBuffer);                
@@ -710,30 +714,33 @@
                                 res = hxreg->GetStrByName(pMountpointStr, pBuffer);
                                 
                                 //Make sure that MP has a slash at the start and end
-                                char szMP[256]= {0};
-                                UCHAR* pStr = pBuffer->GetBuffer();
-
-                                int i = 0;
-                                if (*pStr != '/')
-                                {
-                                    szMP[i++] = '/';
-                                }
-                                while(pStr && *pStr != '\0')
-                                {
-                                    szMP[i] = *pStr;
-                                    i++;
-                                    pStr++;
-                                }
-                                if (*(pStr - 1) != '/')
+                                if (SUCCEEDED(res) && pBuffer)
                                 {
-                                    szMP[i] = '/';
-                                    i++;
-                                }
-                                szMP[i] = '\0';
+                                    char szMP[256]= {0};
+                                    UCHAR* pStr = pBuffer->GetBuffer();
 
-                                pMountpoint = new_string(szMP);
-                                proc->pc->vhost_m3ugen_mountpoint->enter((const \
                char*)sAccountName, pMountpoint);
-                                HX_RELEASE(pBuffer);
+                                    int i = 0;
+                                    if (*pStr != '/')
+                                    {
+                                        szMP[i++] = '/';
+                                    }
+                                    while(pStr && *pStr != '\0')
+                                    {
+                                        szMP[i] = *pStr;
+                                        i++;
+                                        pStr++;
+                                    }
+                                    if (*(pStr - 1) != '/')
+                                    {
+                                        szMP[i] = '/';
+                                        i++;
+                                    }
+                                    szMP[i] = '\0';
+
+                                    pMountpoint = new_string(szMP);
+                                    proc->pc->vhost_m3ugen_mountpoint->enter((const \
char*)sAccountName, pMountpoint); +                                    \
HX_RELEASE(pBuffer); +                                }
                                 break;
                             }
                             HX_RELEASE(pBuffer);                


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic