A real oddity to me is that if I put the plugin into debug mode before
running firefox it all works:

$ export ICEDTEAPLUGIN_DEBUG=true
$ firefox --new-instance 2>&1 | tee /tmp/ffdebug.log

(will attach log momentarily)

after downloading the source package and poking around, I found this
code:

        gchar* proxy;
        uint32_t len;

        gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, 
sizeof(gchar));
        IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
        PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, 
parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], 
decoded_url);

        gchar* proxy_info;

#if MOZILLA_VERSION_COLLAPSED < 1090100
        proxy = (char*) malloc(sizeof(char)*2048);
#endif

        proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", 
parts[3], " ", NULL);
        if (get_proxy_info(decoded_url, &proxy, &len) == NPERR_NO_ERROR)
          {
            proxy_info = g_strconcat (proxy_info, proxy, NULL);
          }

        PLUGIN_DEBUG("Proxy info: %s\n", proxy_info);
        plugin_send_message_to_appletviewer(proxy_info);

        g_free(decoded_url);
        decoded_url = NULL;
        g_free(proxy_info);
        proxy_info = NULL;

#if MOZILLA_VERSION_COLLAPSED < 1090100
        g_free(proxy);
        proxy = NULL;
#endif

note that proxy is only allocated if MOZILLA_VERSION_COLLAPSED < 1090100
(is not even initialized otherwise), but is used if get_proxy_info
succeeds, so on the first invocation we get (potentially) garbage output
like so:

plugin PluginProxyInfo reference 0 �Þ

for whatever reason, having debugging enabled causes this not to happen
(perhaps a side-effect of the fprintf call inside the PLUGIN_DEBUG
macro? I'm not really sure)

Anyway, I am building a possible patch for this right now and will
submit once I have verified that it works as I expect it to.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1222912

Title:
  Error parsing proxy.pac

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/icedtea-web/+bug/1222912/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to