Changeset 745 in openpam for trunk/lib


Ignore:
Timestamp:
Sep 21, 2013, 11:22:48 PM (7 years ago)
Author:
Dag-Erling Smørgrav
Message:

Currently, openpam_policy_path is a hardcoded array of short strings, and
filename is much larger than it needs to be. However, this might not be
the case in the future. To be safe, add a length check after strlcpy().
This should silence a Coverity warning about possible array overflow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/libpam/openpam_configure.c

    r667 r745  
    391391                /* construct filename */
    392392                len = strlcpy(filename, *path, sizeof filename);
     393                if (len >= sizeof filename) {
     394                        errno = ENAMETOOLONG;
     395                        RETURNN(-1);
     396                }
    393397                if (filename[len - 1] == '/') {
    394398                        len = strlcat(filename, service, sizeof filename);
Note: See TracChangeset for help on using the changeset viewer.