Comments (2)
You are right!
Thanks for notifying. I will adapt it.
Maarten
On 1 Sep 2014 07:20, rith87 [email protected] wrote:
There are some places in the code where an object is declared on the stack in a function, passed into some struct as some pointer and then the object goes out of scope. Isn't this rather dangerous since the object goes out of scope?
For example, in trans.c
static void nwl_rx_callback(nwl_rx_res_t* result)
{
...
case D7AQP_COMMAND_TYPE_NA2P_REQUEST:
{
switch (query_result.d7aqp_command.command_code & 0x0F)
{
case D7AQP_OPCODE_ANNOUNCEMENT_FILE:
{
D7AQP_Single_File_Return_Template sfr_tmpl;
sfr_tmpl.return_file_id = data->payload[pointer++];
sfr_tmpl.file_offset = data->payload[pointer++];
sfr_tmpl.isfb_total_length = data->payload[pointer++];
sfr_tmpl.file_data = &data->payload[pointer];
pointer += sfr_tmpl.isfb_total_length - sfr_tmpl.file_offset;
query_result.d7aqp_command.command_data = &sfr_tmpl;
}
}
break;
}
...
trans_rx_query_callback(&query_result);
...
}
So, in the above case, sfr_tmpl goes out of scope outside of the switch and then the callback is called. Am I making sense here? Or is there something I don't know about MSP430 programming?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/8.
from sub-iot-stack.
not relevant anymore after rewrite, closing for now
from sub-iot-stack.
Related Issues (20)
- noise_logger.c compile fails - userbutton.h not found HOT 2
- sniffer.c compile fails - alp_cmd_handler.h not found HOT 1
- I2C on B_L072Z_LRWAN1 platform HOT 2
- Sensor Action example: assertion "is_fs_init_completed" failed HOT 1
- Sensor Action example: incorrect value in RTT logs HOT 4
- STM32 hw_get_unique_id() bug HOT 4
- Gateway software ? HOT 1
- RTT Logging does not work well with Sleep
- Performance results available? HOT 1
- Bug scheduling messages in the unsollicited response callback HOT 8
- Board resets when sending message using default access class at index 1 set to normal rate. HOT 6
- Scheduler hangs when scheduling a task through interrupt service routine HOT 1
- Unkown hardfault when running C++ on B-L072Z-LRWAN1 HOT 2
- Enforce .clang-format
- Assertion fail in timer_fired() HOT 5
- Some compiler flags that cause errors now that might be worth it to be fixed HOT 2
- ALP_ITF_ID_D7ASP interface config format doesn't seem to match spec (same with pyd7a impl) HOT 2
- One-Hop Routing HOT 2
- Variable ctrl not initialized or set
- Compilation Error while running make HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sub-iot-stack.