[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #10302] http_client: Fix argument validation
From: |
Zhang Maiyun |
Subject: |
[lwip-devel] [patch #10302] http_client: Fix argument validation |
Date: |
Tue, 20 Dec 2022 17:53:24 -0500 (EST) |
URL:
<https://savannah.nongnu.org/patch/?10302>
Summary: http_client: Fix argument validation
Project: lwIP - A Lightweight TCP/IP stack
Submitter: myzhang1029
Submitted: Tue 20 Dec 2022 10:53:22 PM UTC
Category: apps
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Tue 20 Dec 2022 10:53:22 PM UTC By: Zhang Maiyun <myzhang1029>
In httpc_get_file, httpc_get_file_dns, and similar functions, there is an
argument
check to make sure server_addr, uri, and recv_fn are not NULL. It suggests
that
settings may be NULL, but setting it NULL immediately causes dereferencing of
null pointers in the following lines.
On the contrary, recv_fn should be allowed to be NULL because httpc_tcp_recv
already checks whether it is set and provides a default action otherwise near
http_client.c
line 342.
I believe this is an error in the argument validation code and httpc_arg.patch
is attached
to fix it.
On a side note, the http_client group of functions really lack documentation
or unit tests.
httpc_doc.patch is my first try. If it looks good, I can continue adding more
documentation, tests, and examples.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 20 Dec 2022 10:53:22 PM UTC Name: httpc_arg.patch Size: 2KiB By:
myzhang1029
<http://savannah.nongnu.org/patch/download.php?file_id=54129>
-------------------------------------------------------
Date: Tue 20 Dec 2022 10:53:22 PM UTC Name: httpc_doc.patch Size: 4KiB By:
myzhang1029
<http://savannah.nongnu.org/patch/download.php?file_id=54130>
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/patch/?10302>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [patch #10302] http_client: Fix argument validation,
Zhang Maiyun <=