diff --git a/ssh-tunnel/pam-http/src/http.c b/ssh-tunnel/pam-http/src/http.c index ef09a3f44..dc5e28dd5 100644 --- a/ssh-tunnel/pam-http/src/http.c +++ b/ssh-tunnel/pam-http/src/http.c @@ -65,9 +65,10 @@ static int getUrl(const char* url, char* buffer, size_t size ) { int isValid(const char* str) { - const int len = strnlen(str, 256); - for( int i = 0; i < len; i++ ) { - if ( !isalnum(str[i] && str[i] != '-') ) { + const int len = strnlen(str, DATASIZE); + int i; + for( i = 0; i < len; i++ ) { + if ( !isalnum(str[i]) && str[i] != '-' ) { return 0; } }