Update of /cvsroot/radmind/radmind
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28112
Modified Files:
repo.c
Log Message:
Verify that event is a single word and has length > 0.
Index: repo.c
===================================================================
RCS file: /cvsroot/radmind/radmind/repo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** repo.c 26 Feb 2007 20:24:15 -0000 1.7
--- repo.c 26 Feb 2007 21:54:33 -0000 1.8
***************
*** 10,13 ****
--- 10,14 ----
#include <sys/time.h>
#include <netinet/in.h>
+ #include <ctype.h>
#include <netdb.h>
#include <stdio.h>
***************
*** 46,50 ****
SNET *sn;
int c, port = htons( 6662 );
! int i = 1, err = 0, len;
int authlevel = _RADMIND_AUTHLEVEL;
int use_randfile = 0;
--- 47,51 ----
SNET *sn;
int c, port = htons( 6662 );
! int i = 0, err = 0, len;
int authlevel = _RADMIND_AUTHLEVEL;
int use_randfile = 0;
***************
*** 125,130 ****
--- 126,144 ----
}
+ /* Make sure event doesn't contain any white space */
if ( event == NULL ) {
err++;
+ } else {
+ len = strlen( event );
+ if ( len == 0 ) {
+ err++;
+ } else {
+ for ( i = 0; i < len; i++ ) {
+ if ( isspace( event[ i ] )) {
+ err++;
+ break;
+ }
+ }
+ }
}
***************
*** 157,160 ****
--- 171,176 ----
strcpy( repodata, argv[ optind ] );
+ /* Skip first token in message */
+ i = 1;
for ( i += optind; i < argc; i++ ) {
if (( strlen( repodata ) + strlen( argv[ i ] ) + 2 )
|