Skip to content

Commit

Permalink
Fix coverity scan issue 79021
Browse files Browse the repository at this point in the history
Copy into fixed size buffer -- A source buffer of statically unknown
size is copied into a fixed-size destination buffer (CWE-120). The
string operation will write past the end of the fixed-size destination
buffer if the source buffer is too large.
  • Loading branch information
sm0svx committed Jan 21, 2015
1 parent 849b8c7 commit 203b031
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/svxlink/remotetrx/remotetrx.cpp
Expand Up @@ -52,6 +52,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <cstring>
#include <cstdlib>
#include <vector>
#include <sstream>


/****************************************************************************
Expand Down Expand Up @@ -766,10 +767,9 @@ static bool logfile_open(void)
logfd = open(logfile_name, O_WRONLY | O_APPEND | O_CREAT, 00644);
if (logfd == -1)
{
char str[256] = "open(\"";
strcat(str, logfile_name);
strcat(str, "\")");
perror(str);
ostringstream ss;
ss << "open(\"" << logfile_name << "\")";
perror(ss.str().c_str());
return false;
}

Expand Down

0 comments on commit 203b031

Please sign in to comment.