diff options
author | Tobias Stoeckmann <tobias@stoeckmann.org> | 2023-12-18 10:04:43 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-12-18 09:10:08 +0000 |
commit | e1fb4764cde22dd3e58ee9b6bc6b687ac19eb61f (patch) | |
tree | 051b106a2ef7c0c3e5f2c134044b11b1a0c07916 /conf | |
parent | 9f733e5f3b8ae092e405d8bffa523a22155a7f6a (diff) | |
download | pam-e1fb4764cde22dd3e58ee9b6bc6b687ac19eb61f.tar.gz pam-e1fb4764cde22dd3e58ee9b6bc6b687ac19eb61f.tar.bz2 pam-e1fb4764cde22dd3e58ee9b6bc6b687ac19eb61f.zip |
conf/pam_conv1: Avoid signed line numbers
Very long input files could overflow the signed integer, which is
undefined behavior. Avoid it by using a large unsigned type.
Co-authored-by: Benny Baumann <BenBE@geshi.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'conf')
-rw-r--r-- | conf/pam_conv1/pam_conv_l.l | 2 | ||||
-rw-r--r-- | conf/pam_conv1/pam_conv_y.y | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/conf/pam_conv1/pam_conv_l.l b/conf/pam_conv1/pam_conv_l.l index 2d973475..db5ab6b9 100644 --- a/conf/pam_conv1/pam_conv_l.l +++ b/conf/pam_conv1/pam_conv_l.l @@ -17,7 +17,7 @@ #include "pam_conv_y.h" - extern int current_line; + extern unsigned long long current_line; %} %option noyywrap diff --git a/conf/pam_conv1/pam_conv_y.y b/conf/pam_conv1/pam_conv_y.y index 67409103..95010b2f 100644 --- a/conf/pam_conv1/pam_conv_y.y +++ b/conf/pam_conv1/pam_conv_y.y @@ -24,7 +24,7 @@ extern int yylex(void); - int current_line=1; + unsigned long long current_line=1; extern char *yytext; /* XXX - later we'll change this to be the specific conf file(s) */ @@ -191,7 +191,7 @@ void yyerror(const char *format, ...) { va_list args; - fprintf(stderr, "line %d: ", current_line); + fprintf(stderr, "line %llu: ", current_line); va_start(args, format); vfprintf(stderr, format, args); va_end(args); |