Skip to content
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

spf_server.c:438 --- array index 6 is past the end of the array (which contains 1 element) #32

Open
hdatma opened this issue Dec 30, 2020 · 0 comments

Comments

@hdatma
Copy link

hdatma commented Dec 30, 2020

Line 438 of spf_server.c reads the size of SPF_VER_STR, which is always 6 by definition, as no code redefines its value. The runtime value of "e" is affected.

./src/include/spf.h:35:#define SPF_VER_STR "v=spf1"

./src/libspf2/spf_server.c:438:13: warning: array index 6 is past the end of the array (which contains 1 element) [-Warray-bounds]
                        char    e = rr_txt->rr[i]->txt[sizeof(SPF_VER_STR) - 1];
                                    ^                  ~~~~~~~~~~~~~~~~~~~~~~~
../../src/include/spf_dns_rr.h:36:5: note: array 'txt' declared here
    char                        txt[1];
    ^
@hdatma hdatma changed the title spf_server.c:438 spf_server.c:438 --- array index 6 is past the end of the array (which contains 1 element) Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant