~ubuntu-branches/ubuntu/saucy/wpasupplicant/saucy

« back to all changes in this revision

Viewing changes to src/eap_peer/eap_fast_pac.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2010-11-22 09:43:43 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122094343-qgsxaojvmswfri77
Tags: 0.7.3-0ubuntu1
* Get wpasupplicant 0.7.3 from Debian's SVN. Leaving 0.7.3-1 as unreleased
  for now.
* Build-Depend on debhelper 8, since the packaging from Debian uses compat 8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
480
480
{
481
481
        size_t i, need;
482
482
        int ret;
 
483
        char *end;
483
484
 
484
 
        if (data == NULL || *buf == NULL)
 
485
        if (data == NULL || buf == NULL || *buf == NULL ||
 
486
            pos == NULL || *pos == NULL || *pos < *buf)
485
487
                return;
486
488
 
487
489
        need = os_strlen(field) + len * 2 + 30;
498
500
                *buf = nbuf;
499
501
                *buf_len += need;
500
502
        }
 
503
        end = *buf + *buf_len;
501
504
 
502
 
        ret = os_snprintf(*pos, *buf + *buf_len - *pos, "%s=", field);
503
 
        if (ret < 0 || ret >= *buf + *buf_len - *pos)
 
505
        ret = os_snprintf(*pos, end - *pos, "%s=", field);
 
506
        if (ret < 0 || ret >= end - *pos)
504
507
                return;
505
508
        *pos += ret;
506
 
        *pos += wpa_snprintf_hex(*pos, *buf + *buf_len - *pos, data, len);
507
 
        ret = os_snprintf(*pos, *buf + *buf_len - *pos, "\n");
508
 
        if (ret < 0 || ret >= *buf + *buf_len - *pos)
 
509
        *pos += wpa_snprintf_hex(*pos, end - *pos, data, len);
 
510
        ret = os_snprintf(*pos, end - *pos, "\n");
 
511
        if (ret < 0 || ret >= end - *pos)
509
512
                return;
510
513
        *pos += ret;
511
514
 
512
515
        if (txt) {
513
 
                ret = os_snprintf(*pos, *buf + *buf_len - *pos,
514
 
                                  "%s-txt=", field);
515
 
                if (ret < 0 || ret >= *buf + *buf_len - *pos)
 
516
                ret = os_snprintf(*pos, end - *pos, "%s-txt=", field);
 
517
                if (ret < 0 || ret >= end - *pos)
516
518
                        return;
517
519
                *pos += ret;
518
520
                for (i = 0; i < len; i++) {
519
 
                        ret = os_snprintf(*pos, *buf + *buf_len - *pos,
520
 
                                          "%c", data[i]);
521
 
                        if (ret < 0 || ret >= *buf + *buf_len - *pos)
 
521
                        ret = os_snprintf(*pos, end - *pos, "%c", data[i]);
 
522
                        if (ret < 0 || ret >= end - *pos)
522
523
                                return;
523
524
                        *pos += ret;
524
525
                }
525
 
                ret = os_snprintf(*pos, *buf + *buf_len - *pos, "\n");
526
 
                if (ret < 0 || ret >= *buf + *buf_len - *pos)
 
526
                ret = os_snprintf(*pos, end - *pos, "\n");
 
527
                if (ret < 0 || ret >= end - *pos)
527
528
                        return;
528
529
                *pos += ret;
529
530
        }