Running iwlist wlan0 scan lists the available networks, but I only see the 6 first characters of each ESSID. Studying the data returned from the SIOCGIWSCAN ioctl I can see that each ESSID is preceded by 6 which I guess is the reported length although I am not sure about this structure format. I am using wireless-tools 30~pre9-5ubuntu2 and the 3.7.0-7.15-generic Linux kernel from Ubuntu.
Patch submitted at http://driverdev.linuxdriverproject.org/pipermail/devel/2013-January/034468.html
A patch referencing this bug report has been merged in Linux v3.8-rc5: commit 811a37effdb11e54e1ff1ddaa944286c88f58487 Author: Tormod Volden <debian.tormod@gmail.com> Date: Wed Jan 9 22:23:32 2013 +0100 staging: wlan-ng: Fix clamping of returned SSID length
Tested and verified on 3.4.27, 3.7.4, 3.8-rc5.