(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:
parent
5dd9b4a993
commit
bb561b5494
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue