[Top][All Lists]

[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)


                 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
check to make sure server_addr, uri, and recv_fn are not NULL. It suggests
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
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:

Date: Tue 20 Dec 2022 10:53:22 PM UTC  Name: httpc_doc.patch  Size: 4KiB   By:



Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]