diff svr-authpubkey.c @ 853:b11cb2518116 ecc

Don't exit fatally if authorized_keys has a line like command="something" ssh-rsa
author Matt Johnston <matt@ucc.asn.au>
date Tue, 12 Nov 2013 23:58:51 +0800
parents 7540c0822374
children 703c7cdd2577
line wrap: on
line diff
--- a/svr-authpubkey.c	Tue Nov 12 23:02:32 2013 +0800
+++ b/svr-authpubkey.c	Tue Nov 12 23:58:51 2013 +0800
@@ -294,8 +294,8 @@
 			options_buf = buf_new(options_len);
 			buf_putbytes(options_buf, options_start, options_len);
 
-			/* compare the algorithm */
-			if (line->pos + algolen > line->len) {
+			/* compare the algorithm. +3 so we have enough bytes to read a space and some base64 characters too. */
+			if (line->pos + algolen+3 > line->len) {
 				continue;
 			}
 			if (strncmp(buf_getptr(line, algolen), algo, algolen) != 0) {