[Libwebsockets] minor logging bug in vhost.c: potential null string printed

Andy Green andy at warmcat.com
Mon Mar 29 21:56:48 CEST 2021



On 3/29/21 12:34 PM, Bram Peeters wrote:
> Hi,
> 
> I ran into a small logging bug  after adding a new mounting point for 
> dynamic content:
> 
> At line 877 of the current git version you have:
> 
> while (mounts) {
> 
> (void)mount_protocols[0];
> 
> lwsl_info(" mounting %s%s to %s\n",
> 
> mount_protocols[mounts->origin_protocol],
> 
> mounts->origin, mounts->mountpoint);
> 
> mounts = mounts->mount_next;
> 
> }
> 
> Since mounts->origin can be NULL (at least it is that way in the 
> minimal-http-server-dynamic.c I started from)  this will start printing 
> a NULL pointer if you have info level enabled.
> 
> (not sure if you prefer to have git issues or check with you via this 
> way first)

Thanks, either way is fine: I pushed a fix on main.

-Andy


More information about the Libwebsockets mailing list