#580 more robust check for remote function

Use strncmp() that is bound to the function name length.
master
OpenGnSys Support Team 2018-11-03 01:11:37 +01:00
parent 97641858c7
commit 08783c9330
1 changed files with 2 additions and 1 deletions

View File

@ -3466,7 +3466,8 @@ static bool gestionaTrama(int socket_c)
nfn = copiaParametro("nfn",ptrTrama); // Toma nombre de la función
for (i = 0; tbfuncionesServer[i].fptr; i++) {
res = strcmp(tbfuncionesServer[i].nf, nfn);
res = strncmp(tbfuncionesServer[i].nf, nfn,
strlen(tbfuncionesServer[i].nf));
if (res == 0) { // Encontrada la función que procesa el mensaje
liberaMemoria(nfn);
res=tbfuncionesServer[i].fptr(socket_c, ptrTrama); // Invoca la función