--- c2s/authreg_pipe.c.orig Tue Nov 30 21:14:59 2004 +++ c2s/authreg_pipe.c Tue Nov 30 21:52:44 2004 @@ -144,13 +144,16 @@ { moddata_t data = (moddata_t) ar->private; char buf[1024]; + int plen; - if(ap_base64encode_len(256) >= 1023) { + plen = strlen(password); + + if(ap_base64encode_len(plen) >= 1023) { log_debug(ZONE, "unable to encode password"); return 1; } - ap_base64encode(buf, password, 256); + ap_base64encode(buf, password, plen); if(_ar_pipe_write(ar, data->out, "CHECK-PASSWORD %s %s %s\n", username, buf, realm) < 0) return 1; @@ -168,13 +171,16 @@ { moddata_t data = (moddata_t) ar->private; char buf[1024]; + int plen; + + plen = strlen(password); - if(ap_base64encode_len(256) >= 1023) { + if(ap_base64encode_len(plen) >= 1023) { log_debug(ZONE, "unable to encode password"); return 1; } - ap_base64encode(buf, password, 256); + ap_base64encode(buf, password, plen); if(_ar_pipe_write(ar, data->out, "SET-PASSWORD %s %s %s\n", username, buf, realm) < 0) return 1;