fixes some potential remote buffer overflows http://marc.theaimsgroup.com/?l=bugtraq&m=104766521328322&w=2 pvalchev@ ok