Changeset 783 in openpam


Ignore:
Timestamp:
Mar 10, 2014, 11:13:05 AM (7 years ago)
Author:
Dag-Erling Smørgrav
Message:

Fix buffer overflow in the b64complete test case by increasing the size
of the buffer used in tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/t_rfc4648.c

    r778 r783  
    188188{
    189189        struct t_case *t = arg;
    190         char buf[64];
     190        char buf[256];
    191191        size_t len;
    192192        int ret;
     
    230230        n = sizeof t_cases / sizeof t_cases[0];
    231231        if ((plan = calloc(n + 1, sizeof *plan)) == NULL ||
    232             (tests = calloc(n + 1, sizeof *tests)) == NULL)
     232            (tests = calloc(n, sizeof *tests)) == NULL)
    233233                return (NULL);
    234234        for (i = 0; i < n; ++i) {
     
    238238                tests[i].arg = &t_cases[i];
    239239        }
     240        plan[n] = NULL;
    240241        return ((const struct t_test **)plan);
    241242}
Note: See TracChangeset for help on using the changeset viewer.