mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-15 01:57:40 -05:00
Fix a segfault in parsing OpenSSH private key files.
The initial test for a line ending with "PRIVATE KEY-----" failed to take into account the possibility that the line might be shorter than that. Fixed by introducing a new library function strendswith(), and strstartswith() for good measure, and using that. Thanks to Hanno Böck for spotting this, with the aid of AFL.
This commit is contained in:
2
misc.h
2
misc.h
@ -52,6 +52,8 @@ int toint(unsigned);
|
||||
|
||||
char *fgetline(FILE *fp);
|
||||
char *chomp(char *str);
|
||||
int strstartswith(const char *s, const char *t);
|
||||
int strendswith(const char *s, const char *t);
|
||||
|
||||
void base64_encode_atom(const unsigned char *data, int n, char *out);
|
||||
int base64_decode_atom(const char *atom, unsigned char *out);
|
||||
|
Reference in New Issue
Block a user