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

The NB socket buffer is too short for NB1500 http, causing overwrite and crash #61

Open
helgerustad opened this issue Dec 2, 2020 · 1 comment
Labels
type: imperfection Perceived defect in any part of project

Comments

@helgerustad
Copy link

I use an NB1500 and sends a http request to fetch a web page. The response is larger than 512 byte. This causes a SW crash. The bug has been identified in NBSocketBuffer.cpp;

  • In NBSocketBuffer.cpp a 512 byte read buffer is allocated: <malloc(NB_SOCKET_BUFFER_SIZE)>.
  • The a read of 512 byte is requested: <MODEM.sendf("AT+USORD=%d,%d", socket, NB_SOCKET_BUFFER_SIZE);>.
  • The library has previously set HEX mode with <AT+UDCONF=1,1>.
  • The modem returns two characters per byte - up to 1024 bytes. The library does not check the length causing overrun and SW crash,

Changing the USORD command line to <MODEM.sendf("AT+USORD=%d,%d", socket, NB_SOCKET_BUFFER_SIZE/2);> is one way to correct the error.

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Dec 2, 2020
@CptHolzschnauz
Copy link
Contributor

i think with
#84
it's solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants