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

directive writing 36 bytes into a region of size between 33 and 64 [-Werror=format-overflow=] #6

Open
dr2okevin opened this issue Sep 7, 2021 · 4 comments

Comments

@dr2okevin
Copy link

I'm getting the following error while running make all, and I have no Idea how to resolve this.

/home/kevin/esp/esp32-sniffer/components/espmqtt/lib/transport_ws.c: In function 'ws_connect':
/home/kevin/esp/esp32-sniffer/components/espmqtt/lib/transport_ws.c:100:53: error: '258EAFA5-E914-47DA-95CA-C5AB...' directive writing 36 bytes into a region of size between 33 and 64 [-Werror=format-overflow=]
     int key_len = sprintf((char*)client_key_b64, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", (char*)client_key);
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kevin/esp/esp32-sniffer/components/espmqtt/lib/transport_ws.c:100:19: note: 'sprintf' output between 37 and 68 bytes into a destination of size 64
     int key_len = sprintf((char*)client_key_b64, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", (char*)client_key);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [/home/kevin/esp/esp-idf/make/component_wrapper.mk:298: lib/transport_ws.o] Fehler 1
make: *** [/home/kevin/esp/esp-idf/make/project.mk:649: component-espmqtt-build] Fehler 2

I'm using Ubuntu 20.04

grafik

@J4NN0
Copy link
Member

J4NN0 commented Sep 7, 2021

Hi @dr2okevin,

I am curious which ESP-IDF are you using?
I've build this firmware times ago, so I don't really remember well but if I remember correctly I used version 3.2. Could you please make sure you're using the same version? Looking at the error I think it's just a version compatibility.

Let me know.

@dr2okevin
Copy link
Author

I have just installed it with the command from the readme
git clone --recursive https://github.com/espressif/esp-idf.git
I couldn't find any version ifnormation besides this

cat toolchain_versions.mk 
SUPPORTED_TOOLCHAIN_COMMIT_DESC = esp-2021r1
SUPPORTED_TOOLCHAIN_GCC_VERSIONS = 8.4.0

CURRENT_TOOLCHAIN_COMMIT_DESC = esp-2021r1
CURRENT_TOOLCHAIN_COMMIT_DESC_SHORT = esp-2021r1
CURRENT_TOOLCHAIN_GCC_VERSION = 8.4.0

@J4NN0
Copy link
Member

J4NN0 commented Sep 9, 2021

As you can see from the official ESP-IDF git repisotory (i.e. the link from which you're clonig the framework) there are different releases.

When you run git clone --recursive https://github.com/espressif/esp-idf.git and clone the repo, you're automatically using the latest stable version (i.e. master branch), that in this case - according to this - is ESP-IDF Release v4.3.1.

Probably there are some "major changes" between v3.x and v4.x - or at least, this is what that screenshot above is suggesting to me. Therefore, what you can try to do is to checkout to branch 3.x (if I remeber correctly I used v3.2, so let's try with this one) and then try again to compile (i.e. make all).

@Rai0Catodic0
Copy link

Hi, I'm facing the same error.
I've tried to use release 3.2 of the EPS-IDF but there is no install script. How did you install that version?

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

3 participants