(trunk libT) fix ABR detected by clang static analyzer in tr_torrentStat.

When copying a value to s->errorString, it used memcpy(a,b,sizeof(a)) where sizeof(a) was larger than sizeof(b). Fixed by replacing the memcpy() call with tr_strlcpy().
This commit is contained in:
Jordan Lee 2011-03-31 04:01:55 +00:00
parent 5dd9b4a993
commit bb561b5494
1 changed files with 1 additions and 1 deletions

View File

@ -1156,7 +1156,7 @@ tr_torrentStat( tr_torrent * tor )
s->id = tor->uniqueId;
s->activity = tr_torrentGetActivity( tor );
s->error = tor->error;
memcpy( s->errorString, tor->errorString, sizeof( s->errorString ) );
tr_strlcpy( s->errorString, tor->errorString, sizeof( s->errorString ) );
s->manualAnnounceTime = tr_announcerNextManualAnnounce( tor );