Ignore:
Timestamp:
Mar 31, 2011, 4:01:55 AM (11 years ago)
Author:
jordan
Message:

(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().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r12248 r12273  
    11571157    s->activity = tr_torrentGetActivity( tor );
    11581158    s->error = tor->error;
    1159     memcpy( s->errorString, tor->errorString, sizeof( s->errorString ) );
     1159    tr_strlcpy( s->errorString, tor->errorString, sizeof( s->errorString ) );
    11601160
    11611161    s->manualAnnounceTime = tr_announcerNextManualAnnounce( tor );
Note: See TracChangeset for help on using the changeset viewer.