Navigation


Changeset 1442:915450ee91c7 in freeDiameter for extensions/app_radgw


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
  • extensions/app_radgw/rgw_clients.c

    r1417 r1442  
    764764                ret = getaddrinfo(buf, NULL, &hint, &res);
    765765                if (ret == 0) {
    766                         strncpy(buf, res->ai_canonname, sizeof(buf));
     766                        snprintf(buf, sizeof(buf), "%s", res->ai_canonname);
    767767                        /* The name was resolved correctly, does it match the IP of the client? */
    768768                        for (ptr = res; ptr != NULL; ptr = ptr->ai_next) {
Note: See TracChangeset for help on using the changeset viewer.