diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-31 03:11:42 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-31 03:11:42 +0000 |
commit | 61b5fd6f32e9ccb612df1354a3e3b3bed5f2b808 (patch) | |
tree | 06d72234112a52e30d5b72e367e42efc43e9762f /source3/libsmb | |
parent | ab4577f141b0c08a543d998a36892bbafae4e902 (diff) | |
download | samba-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/libsmb')
-rw-r--r-- | source3/libsmb/namequery.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 8b0d68ce6a..5e189020ad 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -347,13 +347,13 @@ BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr ptr = line; - if (next_token(&ptr,ip ,NULL)) + if (next_token(&ptr,ip ,NULL,sizeof(ip))) ++count; - if (next_token(&ptr,name ,NULL)) + if (next_token(&ptr,name ,NULL, sizeof(name))) ++count; - if (next_token(&ptr,flags,NULL)) + if (next_token(&ptr,flags,NULL, sizeof(flags))) ++count; - if (next_token(&ptr,extra,NULL)) + if (next_token(&ptr,extra,NULL, sizeof(extra))) ++count; if (count <= 0) @@ -452,7 +452,7 @@ BOOL resolve_name(char *name, struct in_addr *return_ip) ptr = name_resolve_list; if (!ptr || !*ptr) ptr = "host"; - while (next_token(&ptr, tok, LIST_SEP)) { + while (next_token(&ptr, tok, LIST_SEP, sizeof(tok))) { if(strequal(tok, "host") || strequal(tok, "hosts")) { /* |