pam_pkcs11/0001-memory-leak-fixes.patch

30 lines
720 B
Diff

--- a/src/mappers/mapper.c
+++ b/src/mappers/mapper.c
@@ -83,7 +83,12 @@
/* get a line from buffer */
from = mfile->pt;
/* set up pointer */
- while( *from && isspace(*from) ) from++;
+ while( *from && isspace(*from)){
+ if(from - mfile->buffer + 1 >= mfile->length){
+ return 0;
+ }
+ from++;
+ }
to = strchr(from,'\n');
/* if no newline, assume string ends at end of buffer */
if (!to) to=mfile->buffer+mfile->length;
--- a/src/pam_pkcs11/pam_pkcs11.c
+++ b/src/pam_pkcs11/pam_pkcs11.c
@@ -208,7 +208,7 @@
{
int i, rv;
const char *user = NULL;
- char *password;
+ char *password = NULL;
unsigned int slot_num = 0;
int is_a_screen_saver = 0;
struct configuration_st *configuration;