Potentially unsave string processing code replaced
git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@98 cac9541e-1b8d-4bfa-827e-589bba606050
This commit is contained in:
@@ -38,11 +38,10 @@ DBusHandlerResult IntrospectHandler::processMessage( const Message &msg )
|
||||
if( pathlen != 1 ) ++pathlen;
|
||||
const char *end = strchr( DBusManagerPath + pathlen, '/' );
|
||||
if( end ) {
|
||||
char sub[128];
|
||||
const int sublen = end - DBusManagerPath - pathlen;
|
||||
strncpy( sub, DBusManagerPath + pathlen, sublen );
|
||||
sub[ sublen ] = 0;
|
||||
introspect += std::string( "<node name=\"" ) + sub + "\"/>";
|
||||
introspect += "<node name=\"" +
|
||||
std::string( DBusManagerPath + pathlen, sublen )
|
||||
+ "\"/>";
|
||||
} else
|
||||
introspect += "<node name=\"Manager\"/><node name=\"drives\"/>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user