summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-31 03:11:42 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-31 03:11:42 +0000
commit61b5fd6f32e9ccb612df1354a3e3b3bed5f2b808 (patch)
tree06d72234112a52e30d5b72e367e42efc43e9762f /source3/utils
parentab4577f141b0c08a543d998a36892bbafae4e902 (diff)
downloadsamba-61b5fd6f32e9ccb612df1354a3e3b3bed5f2b808.tar.gz
samba-61b5fd6f32e9ccb612df1354a3e3b3bed5f2b808.tar.bz2
samba-61b5fd6f32e9ccb612df1354a3e3b3bed5f2b808.zip
bounds check next_token() to prevent possible buffer overflows
(This used to be commit 3eade55dc7c842bdc50205c330802d211fae54d3)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/make_smbcodepage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/utils/make_smbcodepage.c b/source3/utils/make_smbcodepage.c
index 86c9df3a18..155ed5aeb5 100644
--- a/source3/utils/make_smbcodepage.c
+++ b/source3/utils/make_smbcodepage.c
@@ -244,7 +244,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu
unsigned char b = 0;
/* Get the 'lower' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse first value");
if(!parse_byte( token_buf, &b))
parse_error(buf, "first value doesn't resolve to a byte");
@@ -253,7 +253,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu
SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4),b);
/* Get the 'upper' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse second value");
if(!parse_byte( token_buf, &b))
parse_error(buf, "second value doesn't resolve to a byte");
@@ -262,7 +262,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu
SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4) + 1,b);
/* Get the 'upper to lower' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse third value");
if(!parse_bool( token_buf, &b))
parse_error(buf, "third value doesn't resolve to a boolean");
@@ -271,7 +271,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu
SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4) + 2,b);
/* Get the 'lower to upper' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse fourth value");
if(!parse_bool( token_buf, &b))
parse_error(buf, "fourth value doesn't resolve to a boolean");