• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
http code 301 causes segfault
#1
An http response with code 301 causes a segfault.

I got these headers

Code:
HTTP/1.0 301 Moved Permanently
Location: http://raspi4/nodeMcu2/
Content-Length: 0
Connection: close
Date: Sat, 11 Aug 2018 11:15:15 GMT
Server: lighttpd/1.4.35

And then this segfault occurs:

Code:
Thread 1 "pilight-daemon" received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/arm/armv6/strlen.S:26
26      ../sysdeps/arm/armv6/strlen.S: Bestand of map bestaat niet.
(gdb) backtrace
#0  strlen () at ../sysdeps/arm/armv6/strlen.S:26
#1  0x767c4e7c in read_cb (req=0x444a8, nread=0x449f4, buf=0x43550 "") at /home/pi/pilight/libs/pilight/core/http.c:583
#2  0x767bd410 in uv_custom_poll_cb (req=0x444a8, status=0, events=1) at /home/pi/pilight/libs/pilight/core/eventpool.c:710
#3  0x7679b724 in uv__poll_io (loop=0x76fa7f80 <default_loop_struct>, w=0x444dc, events=1) at /home/pi/pilight/libs/libuv/unix/poll.c:64
#4  0x76794fc4 in uv__io_poll (loop=0x76fa7f80 <default_loop_struct>, timeout=999) at /home/pi/pilight/libs/libuv/unix/linux-core.c:400
#5  0x7678b678 in uv_run (loop=0x76fa7f80 <default_loop_struct>, mode=UV_RUN_DEFAULT) at /home/pi/pilight/libs/libuv/unix/core.c:362
#6  0x0001cd34 in main (argc=4, argv=0x7efff794) at /home/pi/pilight/daemon.c:3506
(gdb) frame 1
#1  0x767c4e7c in read_cb (req=0x444a8, nread=0x449f4, buf=0x43550 "") at /home/pi/pilight/libs/pilight/core/http.c:583
583                                             request->callback(c.status_code, location, strlen(location), NULL, request->userdata);

I guess that  "location" is NULL, even though a Location header is present.
 
Reply
#2
Fixed. Thanks for reporting!
 
Reply
#3
Thanks.

Will you backport it to staging too?
 
Reply
#4
Forgot to actuallly push.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [SOLVED] Triggering generic_switch leads to segfault Ulrich.Arnold 19 782 10-23-2019, 09:03 AM
Last Post: Ulrich.Arnold
  ][solved]Segfault when retrieving big chunked http message Niek 21 5,863 11-29-2018, 03:17 PM
Last Post: curlymo
  no callback on some http requests Niek 20 6,422 07-28-2018, 10:22 AM
Last Post: Niek
  http library doesn't properly handle big response Niek 39 6,811 07-17-2018, 07:26 PM
Last Post: curlymo
  Long label text causes segfault Niek 10 1,330 06-29-2018, 02:18 PM
Last Post: Niek

Forum Jump:


Browsing: 1 Guest(s)