File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,8 @@ void MDNSResponder::_parsePacket(){
290
290
uint16_t servicePort = 0 ;
291
291
292
292
char protoName[32 ];
293
- uint8_t protoNameLen;
293
+ protoName[0 ] = 0 ;
294
+ uint8_t protoNameLen = 0 ;
294
295
295
296
uint16_t packetHeader[6 ];
296
297
@@ -330,7 +331,7 @@ void MDNSResponder::_parsePacket(){
330
331
serviceName[serviceNameLen] = ' \0 ' ;
331
332
332
333
if (serviceName[0 ] == ' _' ){
333
- memcpy (serviceName, serviceName+1 , serviceNameLen);
334
+ memmove (serviceName, serviceName+1 , serviceNameLen);
334
335
serviceNameLen--;
335
336
serviceParsed = true ;
336
337
} else if (serviceNameLen == 5 && strcmp (" local" , serviceName) == 0 ){
@@ -362,7 +363,7 @@ void MDNSResponder::_parsePacket(){
362
363
_conn_readS (protoName, protoNameLen);
363
364
protoName[protoNameLen] = ' \0 ' ;
364
365
if (protoNameLen == 4 && protoName[0 ] == ' _' ){
365
- memcpy (protoName, protoName+1 , protoNameLen);
366
+ memmove (protoName, protoName+1 , protoNameLen);
366
367
protoNameLen--;
367
368
protoParsed = true ;
368
369
} else {
You can’t perform that action at this time.
0 commit comments