Changeset 858 in openpam for trunk/lib


Ignore:
Timestamp:
Mar 19, 2015, 12:07:19 AM (6 years ago)
Author:
Dag-Erling Smørgrav
Message:

Increment by three, not one, after successfully decoding a character.
Add a boundary check.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/liboath/oath_uri_decode.c

    r788 r858  
    5959                ilen = strlen(in);
    6060        for (ipos = opos = 0; ipos < ilen && in[ipos] != '\0'; ++ipos, ++opos) {
    61                 if (in[ipos] == '%' &&
     61                if (in[ipos] == '%' && ipos + 2 < ilen &&
    6262                    is_xdigit(in[ipos + 1]) && is_xdigit(in[ipos + 2])) {
    6363                        if (out != NULL && opos < olen - 1)
     
    6565                                    unhex(in[ipos + 2]);
    6666                        ilen += 2;
     67                        ipos += 2;
    6768                } else {
    6869                        if (out != NULL && opos < olen - 1)
Note: See TracChangeset for help on using the changeset viewer.