ldapbindrequest with password created invalid packet

ldapclient only evaluated the first record
minor robustness fixes for tinyldap
This commit is contained in:
leitner
2002-07-09 19:53:15 +00:00
parent 5706ea2e53
commit c992e45561
3 changed files with 33 additions and 26 deletions

View File

@@ -15,6 +15,7 @@
#include "ip6.h"
#include <wait.h>
#endif
#include <signal.h>
#define verbose 1
#define debug 1
@@ -523,7 +524,7 @@ int handle(int in,int out) {
int res;
long messageid,op,Len;
if (tmp==0)
if (!len) { return 0; }
if (BUFSIZE-len) { return 0; }
if (tmp<0) { write(2,"error!\n",7); return 1; }
len+=tmp;
res=scan_ldapmessage(buf,buf+len,&messageid,&op,&Len);
@@ -772,6 +773,8 @@ int main() {
int sock;
#endif
signal(SIGPIPE,SIG_IGN);
map=mmap_read("data",&filelen);
if (!map) {
buffer_putsflush(buffer_2,"could not open data!\n");