lwIP - A Lightweight TCP/IP stack - Bugs: bug #27105, realloc() cannot replace...
You are not allowed to post comments on this tracker with your current authentication level.
bug #27105: realloc() cannot replace mem_realloc()
Submitter: | Derek Guerdon <dguerdon> | ||
Submitted: | Sat 25 Jul 2009 04:14:22 AM UTC | ||
Category: | pbufs | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | CVS Head |
Jump to the original submission
Tue 28 Jul 2009 05:20:31 PM UTC, comment #7: |
Simon Goldschmidt <goldsimon> |
Tue 28 Jul 2009 02:14:02 PM UTC, comment #6: Thanks for digging up the background Derek.
|
Kieran Mansley <kieranm> |
Tue 28 Jul 2009 01:46:28 PM UTC, comment #5: #define mem_realloc(x,y) (x) does work.
|
Derek Guerdon <dguerdon> |
Tue 28 Jul 2009 06:06:08 AM UTC, comment #4:
|
Simon Goldschmidt <goldsimon> |
Mon 27 Jul 2009 09:18:55 PM UTC, comment #3: A standards-compliant realloc (pick your favorite: posix, ISO C, etc.) is permitted to move the allocated memory if the size changes, whether it shrinks or grows.
|
Jeff Barber <jeffbabar> |
Mon 27 Jul 2009 07:36:33 PM UTC, comment #2: I did a quick test with DNS (which uses pbuf_realloc) and it works for me. Since mem_realloc is only used in pbuf_realloc in one specific case, I don't think the risk is very high. |
Simon Goldschmidt <goldsimon> |
Mon 27 Jul 2009 03:29:30 PM UTC, comment #1: Can anyone test something such as
|
Kieran Mansley <kieranm> |
Sat 25 Jul 2009 04:14:22 AM UTC, original submission:
In mem.h, the following line causes incorrect behavior:
|
Derek Guerdon <dguerdon> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2009-07-28 | goldsimon | Assigned to | None | goldsimon | |
Open/Closed | Open | Closed | |||
2009-07-28 | goldsimon | Status | None | Fixed | |
2009-07-28 | kieranm | Planned Release | 1.3.1 |
Powered by Savane 3.13-d3ae.
Corresponding source code
Checked that in, since it's certainly the least invasive change to be done before the release. I've created a static function, since the inline statement does not exist in C. Any good compiler should optimize that function away unless its address is used (as required in #23254).