Changeset 577:9dae8bc2d04a in freeDiameter for extensions/app_diameap
- Timestamp:
- Oct 20, 2010, 3:37:49 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/app_diameap
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_diameap/diameap_mysql.c
r444 r577 83 83 84 84 user->id = atoi(row[0]); 85 CHECK_MALLOC(user->userid=malloc(strlen(row[1]) ));86 memcpy(user->userid,row[1],strlen(row[1]) );85 CHECK_MALLOC(user->userid=malloc(strlen(row[1])+1)); 86 memcpy(user->userid,row[1],strlen(row[1])+1); 87 87 user->useridLength = strlen(row[1]); 88 CHECK_MALLOC(user->password=malloc(strlen(row[2]) ));89 memcpy(user->password, row[2],strlen(row[2]) );88 CHECK_MALLOC(user->password=malloc(strlen(row[2])+1)); 89 memcpy(user->password, row[2],strlen(row[2])+1); 90 90 user->passwordLength = strlen(row[2]); 91 91 user->proposed_eap_method = atoi(row[3]); -
extensions/app_diameap/diameap_server.c
r565 r577 161 161 diameap_sm->eap_sm.user.useridLength 162 162 = diameap_sess_data->user.useridLength; 163 CHECK_MALLOC(diameap_sm->eap_sm.user.userid= malloc(diameap_sm->eap_sm.user.useridLength ));164 U8COPY(diameap_sm->eap_sm.user.userid,0,diameap_sm->eap_sm.user.useridLength ,diameap_sess_data->user.userid);163 CHECK_MALLOC(diameap_sm->eap_sm.user.userid= malloc(diameap_sm->eap_sm.user.useridLength+1)); 164 U8COPY(diameap_sm->eap_sm.user.userid,0,diameap_sm->eap_sm.user.useridLength+1,diameap_sess_data->user.userid); 165 165 free(diameap_sess_data->user.userid); 166 166 diameap_sess_data->user.userid = NULL; … … 179 179 diameap_sm->eap_sm.user.passwordLength 180 180 = diameap_sess_data->user.passwordLength; 181 CHECK_MALLOC(diameap_sm->eap_sm.user.password = malloc(diameap_sm->eap_sm.user.passwordLength ));182 U8COPY(diameap_sm->eap_sm.user.password,0,diameap_sm->eap_sm.user.passwordLength , diameap_sess_data->user.password);181 CHECK_MALLOC(diameap_sm->eap_sm.user.password = malloc(diameap_sm->eap_sm.user.passwordLength+1)); 182 U8COPY(diameap_sm->eap_sm.user.password,0,diameap_sm->eap_sm.user.passwordLength+1, diameap_sess_data->user.password); 183 183 free(diameap_sess_data->user.password); 184 184 diameap_sess_data->user.password = NULL; … … 1033 1033 diameap_sess_data->user.useridLength 1034 1034 = diameap_sm->eap_sm.user.useridLength; 1035 CHECK_MALLOC(diameap_sess_data->user.userid= malloc(diameap_sess_data->user.useridLength ));1036 U8COPY(diameap_sess_data->user.userid,0,diameap_sess_data->user.useridLength ,diameap_sm->eap_sm.user.userid);1035 CHECK_MALLOC(diameap_sess_data->user.userid= malloc(diameap_sess_data->user.useridLength+1)); 1036 U8COPY(diameap_sess_data->user.userid,0,diameap_sess_data->user.useridLength+1,diameap_sm->eap_sm.user.userid); 1037 1037 free(diameap_sm->eap_sm.user.userid); 1038 1038 diameap_sm->eap_sm.user.userid = NULL; … … 1050 1050 diameap_sess_data->user.passwordLength 1051 1051 = diameap_sm->eap_sm.user.passwordLength; 1052 CHECK_MALLOC(diameap_sess_data->user.password = malloc(diameap_sess_data->user.passwordLength ));1053 U8COPY(diameap_sess_data->user.password,0,diameap_sess_data->user.passwordLength ,diameap_sm->eap_sm.user.password);1052 CHECK_MALLOC(diameap_sess_data->user.password = malloc(diameap_sess_data->user.passwordLength+1)); 1053 U8COPY(diameap_sess_data->user.password,0,diameap_sess_data->user.passwordLength+1,diameap_sm->eap_sm.user.password); 1054 1054 free(diameap_sm->eap_sm.user.password); 1055 1055 diameap_sm->eap_sm.user.password = NULL; -
extensions/app_diameap/plugins/eap_identity/eap_identity.c
r565 r577 141 141 ret=diameap_get_eap_user(&(smd->user),"Default User"); 142 142 CHECK_MALLOC_DO(smd->user.userid=realloc(smd->user.userid,strlen(user)+1),{ret = 1; goto next;}); 143 memcpy(smd->user.userid,user,strlen(user) );143 memcpy(smd->user.userid,user,strlen(user)+1); 144 144 smd->user.useridLength = strlen(user); 145 145 } else { -
extensions/app_diameap/plugins/eap_tls/eap_tls.c
r565 r577 220 220 goto failure;}); 221 221 222 if(str cmp((char *)smd->user.userid,buff)!=0){222 if(strncmp((char *)smd->user.userid,buff,smd->user.useridLength)!=0){ 223 223 goto failure; 224 224 }
Note: See TracChangeset
for help on using the changeset viewer.