mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-27 07:58:49 +01:00
fix parsing of relay ids by replacing separating \n with \0.
This commit is contained in:
parent
111c59dd30
commit
1720fbbd50
1 changed files with 19 additions and 17 deletions
|
@ -773,25 +773,27 @@ handle_proxy_tproc( void* closure )
|
|||
int ii;
|
||||
for ( ii = 0; ii < nameCount; ++ii ) {
|
||||
unsigned short seed;
|
||||
if ( getNetShort( &bufp, end, &seed ) ) {
|
||||
const unsigned char* crptr =
|
||||
if ( !getNetShort( &bufp, end, &seed ) ) {
|
||||
break;
|
||||
}
|
||||
unsigned char* crptr =
|
||||
(unsigned char*)strchr( (char*)bufp, '\n' );
|
||||
if ( NULL != crptr && crptr < end ) {
|
||||
if ( NULL == crptr || crptr >= end ) {
|
||||
break;
|
||||
}
|
||||
*crptr = '\0';
|
||||
|
||||
HostID hid;
|
||||
char connName[MAX_CONNNAME_LEN+1];
|
||||
if ( parseRelayID( (char*)bufp, connName,
|
||||
if ( !parseRelayID( (const char*)bufp, connName,
|
||||
&hid ) ) {
|
||||
break;
|
||||
}
|
||||
SafeCref scr( connName );
|
||||
scr.DeviceGone( hid, seed );
|
||||
}
|
||||
|
||||
/* skip "\n" */
|
||||
bufp = (unsigned char*)crptr + 1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
bufp = crptr + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue