New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Table Value Type Verification #168

Open
jsiwek opened this Issue Sep 17, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@jsiwek
Copy link
Member

jsiwek commented Sep 17, 2018

Moved from https://bro-tracker.atlassian.net/browse/BIT-1859

Created by Aaron Eppert at 2017-10-21T11:39:24.735-0500:

event bro_init(){
    local service_table : table[string, count] of count = {["www", 80] = "Internal Web Server", 
                                                           ["dns1", 53] = "Internal DNS 1",
                                                           ["dns2", 53] = "Internal DNS 2", 
                                                           ["dhcp-for-wifi", 443] = "DHCP Management interface for WiFi"};

    print service_table;
}

The above snippet works fine, but notice the values of the table are strings not counts. However, if we change any table value to a count, an error is raised.

event bro_init(){
    local service_table : table[string, count] of count = {["www", 80] = "Internal Web Server", 
                                                           ["dns1", 53] = "Internal DNS 1",
                                                           ["dns2", 53] = 3, 
                                                           ["dhcp-for-wifi", 443] = "DHCP Management interface for WiFi"};

    print service_table;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment