mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/gh-1245-tld-validity'
* origin/topic/jsiwek/gh-1245-tld-validity: GH-1245: require TLD of hostname literals to start with a letter
This commit is contained in:
commit
75caf60990
6 changed files with 21 additions and 2 deletions
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
|||
3.3.0-dev.486 | 2020-10-26 10:41:48 -0700
|
||||
|
||||
* GH-1245: require TLD of hostname literals to start with a letter (Jon Siwek, Corelight)
|
||||
|
||||
3.3.0-dev.484 | 2020-10-23 14:47:44 -0700
|
||||
|
||||
* Add coveralls badge to README.md (Tim Wojtulewicz)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
3.3.0-dev.484
|
||||
3.3.0-dev.486
|
||||
|
|
|
@ -142,6 +142,7 @@ FILE [^ \t\n]+
|
|||
PREFIX [^ \t\n]+
|
||||
FLOAT (({D}*"."?{D})|({D}"."?{D}*))([eE][-+]?{D})?
|
||||
H [A-Za-z0-9][A-Za-z0-9\-]*
|
||||
HTLD [A-Za-z][A-Za-z0-9\-]*
|
||||
ESCSEQ (\\([^\n]|[0-7]+|x[[:xdigit:]]+))
|
||||
|
||||
%%
|
||||
|
@ -502,7 +503,7 @@ F RET_CONST(zeek::val_mgr->False()->Ref())
|
|||
|
||||
"0x"{HEX}+ RET_CONST(zeek::val_mgr->Count(static_cast<bro_uint_t>(strtoull(yytext, 0, 16))).release())
|
||||
|
||||
{H}("."{H})+ RET_CONST(zeek::detail::dns_mgr->LookupHost(yytext).release())
|
||||
({H}".")+{HTLD} RET_CONST(zeek::detail::dns_mgr->LookupHost(yytext).release())
|
||||
|
||||
\"([^\\\n\"]|{ESCSEQ})*\" {
|
||||
const char* text = yytext;
|
||||
|
|
2
testing/btest/Baseline/language.invalid-hostnames-2/out
Normal file
2
testing/btest/Baseline/language.invalid-hostnames-2/out
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/invalid-hostnames.zeek, line 4: syntax error, at or near "f"
|
2
testing/btest/Baseline/language.invalid-hostnames/out
Normal file
2
testing/btest/Baseline/language.invalid-hostnames/out
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/invalid-hostnames.zeek, line 4: unknown identifier print0, at or near "print0"
|
10
testing/btest/language/invalid-hostnames.zeek
Normal file
10
testing/btest/language/invalid-hostnames.zeek
Normal file
|
@ -0,0 +1,10 @@
|
|||
# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
|
||||
|
||||
print0.0000000000005;
|
||||
|
||||
# @TEST-START-NEXT
|
||||
|
||||
# This is not a floating-point literal (like you'd see in C/C++) and it's
|
||||
# also not a valid hostname since the TLD does not start with a letter.
|
||||
print 0.05f;
|
Loading…
Add table
Add a link
Reference in a new issue