Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 156687) +++ apps/app_voicemail.c (working copy) @@ -6730,6 +6730,10 @@ cmd = ast_readstring(chan,newpassword + strlen(newpassword),sizeof(newpassword)-1,2000,10000,"#"); if (cmd < 0 || cmd == 't' || cmd == '#') return cmd; + if (ast_strlen_zero(newpassword)) { + /* Disallow blank password -- this may happen if/when the user is distracted. */ + continue; + } newpassword2[1] = '\0'; newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword"); if (cmd == '#') @@ -6837,6 +6841,10 @@ break; if ((cmd = ast_readstring(chan,newpassword + strlen(newpassword),sizeof(newpassword)-1,2000,10000,"#")) < 0) { break; + } else if (ast_strlen_zero(newpassword)) { + /* Disallow blank password */ + cmd = 0; + break; } } newpassword2[1] = '\0'; @@ -6847,7 +6855,8 @@ if (cmd < 0) break; - if ((cmd = ast_readstring(chan,newpassword2 + strlen(newpassword2),sizeof(newpassword2)-1,2000,10000,"#"))) { + if ((cmd = ast_readstring(chan,newpassword2 + strlen(newpassword2),sizeof(newpassword2)-1,2000,10000,"#")) < 0) { + /* On hangup, don't change the password */ break; } }