mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-18 20:57:56 +00:00
Ensure received message buffer is terminated
This commit is contained in:
parent
9b3c4f13bb
commit
f532b32efa
4
server.c
4
server.c
@ -209,8 +209,12 @@ int processRequest(unsigned char *packet,int len,
|
||||
char messageLen = packet[pofs];
|
||||
pofs++;
|
||||
strncpy(emitterPhoneNumber, (const char*)packet+pofs, emitterPhoneNumberLen);
|
||||
emitterPhoneNumber[emitterPhoneNumberLen]=0;
|
||||
|
||||
pofs+=emitterPhoneNumberLen;
|
||||
strncpy(message, (const char*)packet+pofs, messageLen);
|
||||
message[messageLen]=0;
|
||||
|
||||
pofs+=messageLen;
|
||||
|
||||
// Check if I'm the recipient
|
||||
|
Loading…
Reference in New Issue
Block a user