[Pianod] Segmentation Fault

Brian Moyer bdm310 at gmail.com
Thu Jun 19 10:16:11 PDT 2014


Pianod stopped working a day or two ago with a segmentation fault when
playing any station.  Investigation resulted in the following.

Feedback response from Pandora looks like this:


"feedback":{"thumbsUp":[],"totalThumbsUp":0,"totalThumbsDown":0,"thumbsDown":[]}

The outer two elements are JSON arrays while the inner two are integers.

The offending code is located at the very end of libpiano\response.c:

     json_object_object_foreach (feedback, key, val) {
          for (size_t i = 0; i < json_object_array_length (val); i++) {

Here we attempt to loop through the feedback response and each array
element of each element in the feedback response.  Once we try to get the
array length of the integer elements, we get a segmentation fault.

Testing to see if the element type is json_type_array before trying to loop
through it's elements solves the immediate issue.  I assume something
changed on Pandora's side and I don't know pianod well enough to see if
this has other effects.

This took a few hours to track down, figured I'd put it out there to save
someone else the initial bug tracking time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deviousfish.com/pipermail/pianod-deviousfish.com/attachments/20140619/8e6febb2/attachment.htm>


More information about the Pianod mailing list