SF ticket #116 UpnpRemoveVirtualDir wrong linked list operation
What if pVirtualDirList has two nodes and what we want to delete is the
first one. Patch attached.
(cherry picked from commit 907c7c2621
)
This commit is contained in:

committed by
Marcelo Roberto Jimenez

parent
97b6be674a
commit
a641a27cb6
@@ -349,6 +349,13 @@ Version 1.8.0
|
|||||||
Version 1.6.19
|
Version 1.6.19
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
|
2013-07-30 Zheng Peng <darkelf2010(at)users.sf.net>
|
||||||
|
|
||||||
|
SF ticket #116 UpnpRemoveVirtualDir wrong linked list operation
|
||||||
|
|
||||||
|
What if pVirtualDirList has two nodes and what we want to delete is the
|
||||||
|
first one. Patch attached.
|
||||||
|
|
||||||
2013-07-30 Sebastian Brandt <s.brandt(at)aixtrusion.de>
|
2013-07-30 Sebastian Brandt <s.brandt(at)aixtrusion.de>
|
||||||
|
|
||||||
Dear libupnp-devels,
|
Dear libupnp-devels,
|
||||||
|
1
THANKS
1
THANKS
@@ -69,4 +69,5 @@ exempt of errors.
|
|||||||
- Tom (tomdev2)
|
- Tom (tomdev2)
|
||||||
- Yoichi Nakayama (yoichi)
|
- Yoichi Nakayama (yoichi)
|
||||||
- zephyrus (zephyrus00jp)
|
- zephyrus (zephyrus00jp)
|
||||||
|
- Zheng Peng (darkelf2010)
|
||||||
|
|
||||||
|
@@ -4187,16 +4187,17 @@ int UpnpRemoveVirtualDir(const char *dirName)
|
|||||||
return UPNP_E_INVALID_PARAM;
|
return UPNP_E_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
/* Handle the special case where the directory that we are */
|
/* Handle the special case where the directory that we are */
|
||||||
/* removing is the first and only one in the list. */
|
/* removing is the first in the list. */
|
||||||
if( ( pVirtualDirList->next == NULL ) &&
|
if (strcmp( pVirtualDirList->dirName, dirName ) == 0)
|
||||||
( strcmp( pVirtualDirList->dirName, dirName ) == 0 ) ) {
|
{
|
||||||
free( pVirtualDirList );
|
pPrev = pVirtualDirList;
|
||||||
pVirtualDirList = NULL;
|
pVirtualDirList = pVirtualDirList->next;
|
||||||
|
free( pPrev );
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
pCur = pVirtualDirList;
|
pCur = pVirtualDirList->next;
|
||||||
pPrev = pCur;
|
pPrev = pVirtualDirList;
|
||||||
|
|
||||||
while( pCur != NULL ) {
|
while( pCur != NULL ) {
|
||||||
if( strcmp( pCur->dirName, dirName ) == 0 ) {
|
if( strcmp( pCur->dirName, dirName ) == 0 ) {
|
||||||
|
Reference in New Issue
Block a user