Navigation


Changeset 1442:915450ee91c7 in freeDiameter for libfdproto


Ignore:
Timestamp:
Feb 27, 2020, 2:19:24 PM (4 years ago)
Author:
Luke Mewburn <luke@mewburn.net>
Branch:
default
Phase:
public
Message:

fix gcc 9.1.1 compile warnings

Use snprintf instead of strncpy to ensure NUL termination.

Simplify attribute copying to calloc/memcpy instead
of malloc/memset/strncpy/assignment.

Appeases gcc 9.1.1 warnings about strncpy bounds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/messages.c

    r1423 r1442  
    22352235                                                error_info->pei_errcode = "DIAMETER_INVALID_AVP_VALUE";
    22362236                                                error_info->pei_avp = avp;
    2237                                                 strncpy(error_message, err, sizeof(error_message));
     2237                                                snprintf(error_message, sizeof(error_message), "%s", err);
    22382238                                                error_info->pei_message = error_message;
    22392239                                } else {
Note: See TracChangeset for help on using the changeset viewer.