RT-Thread / RT-Thread/rt-thread

at_delete_resp函数问题

Open
#7,085 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

at_delete_resp函数的resp=RT_NULL操作,无法置实参为RT_NULL
https://github.com/RT-Thread/rt-thread/blob/765c2ec5f92e82596e1edc2cab6b1a741fd1cc3e/components/net/at/src/at_client.c#L94

调用at样例中大多数这样使用:at_delete_resp(resp)
实参resp在调用后并未被置为RT_NULL
若后续使用resp变量会出问题。

目前只能在at_delete_resp(resp)后,再写一行resp=RT_NULL。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect at_delete_resp in components/net/at/src/at_client.c around line 94, then search the AT examples and other call sites that invoke it with resp. Determine how the API can ensure the caller's resp is cleared, and verify that subsequent use of the variable is safe across the affected call sites.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.