Skip to content

Commit

Permalink
Fix buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
hallard committed Jun 14, 2020
1 parent 4e2a5b6 commit 8bdba6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/LibTeleinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,12 @@ char * TInfo::valueGet(char * name, char * value)
me = me->next;

// Check if we match this LABEL
if (lgname==strlen(me->name) && strncmp(me->name, name, lgname)==0) {
if (lgname==strlen(me->name) && strcmp(me->name, name)==0) {
// this one has a value ?
if (me->value) {
// copy to dest buffer
uint8_t lgvalue = strlen(me->value);
strlcpy(value, me->value , lgvalue );
strlcpy(value, me->value , lgvalue + 1 );
return ( value );
}
}
Expand Down Expand Up @@ -662,7 +662,7 @@ ValueList * TInfo::checkLine(char * pline)
return NULL;

// Get our own working copy
strlcpy( buff, _recv_buff, len+1);
strlcpy( buff, pline, len+1);

p = &buff[0];
ptok = p; // for sure we start with token name
Expand Down

0 comments on commit 8bdba6f

Please sign in to comment.