comparison extensions/app_radgw/radius.c @ 552:d2be88628747

Bug fix
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 15 Sep 2010 14:45:55 +0900
parents 4c935aecee6c
children 153cd2600fcf
comparison
equal deleted inserted replaced
551:27f833e7f9c4 552:d2be88628747
588 /* Now move all the proxy-state attributes at the end of the attr_pos array */ 588 /* Now move all the proxy-state attributes at the end of the attr_pos array */
589 if (temp_msg->ps_nb) { 589 if (temp_msg->ps_nb) {
590 size_t *temp_ps = NULL; 590 size_t *temp_ps = NULL;
591 int n, new_n = 0, p = 0; 591 int n, new_n = 0, p = 0;
592 592
593 CHECK_MALLOC( temp_ps = calloc(temp_msg->ps_nb, sizeof(size_t *)) ); 593 CHECK_MALLOC( temp_ps = calloc(temp_msg->ps_nb, sizeof(size_t)) );
594 594
595 /* Move all the Proxy-State attributes into the temp_ps array */ 595 /* Move all the Proxy-State attributes into the temp_ps array */
596 for (n=0; n < temp_msg->radius.attr_used; n++) { 596 for (n=0; n < temp_msg->radius.attr_used; n++) {
597 struct radius_attr_hdr * attr = (struct radius_attr_hdr *)(temp_msg->radius.buf + temp_msg->radius.attr_pos[n]); 597 struct radius_attr_hdr * attr = (struct radius_attr_hdr *)(temp_msg->radius.buf + temp_msg->radius.attr_pos[n]);
598 598
604 } 604 }
605 temp_msg->radius.attr_used = new_n; /* hide the proxy-state to other modules */ 605 temp_msg->radius.attr_used = new_n; /* hide the proxy-state to other modules */
606 temp_msg->ps_first = new_n; 606 temp_msg->ps_first = new_n;
607 607
608 /* And back into the array */ 608 /* And back into the array */
609 memcpy(temp_msg->radius.attr_pos + new_n, temp_ps, p * sizeof(size_t *)); 609 memcpy(temp_msg->radius.attr_pos + new_n, temp_ps, p * sizeof(size_t));
610 free(temp_ps); 610 free(temp_ps);
611 } 611 }
612 612
613 *msg = temp_msg; 613 *msg = temp_msg;
614 return 0; 614 return 0;
"Welcome to our mercurial repository"