summaryrefslogtreecommitdiffstats
path: root/sources/ogAdmServer.cpp
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2018-11-03 01:11:37 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-01-17 13:18:30 +0100
commit08783c93308ec84912428afc97d93d53b93fd3d3 (patch)
treeeb9c930a5bbd43ace718a055c6ffec845ed009a7 /sources/ogAdmServer.cpp
parent97641858c74f01032c573155b95b38d02922f5ff (diff)
#580 more robust check for remote function
Use strncmp() that is bound to the function name length.
Diffstat (limited to 'sources/ogAdmServer.cpp')
-rw-r--r--sources/ogAdmServer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp
index ec5430d..d4a9290 100644
--- a/sources/ogAdmServer.cpp
+++ b/sources/ogAdmServer.cpp
@@ -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