After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 170628 - gweather not robust against unexpected input
gweather not robust against unexpected input
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: gweather
2.14.x
Other All
: High critical
: 2.14
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
: 172198 301805 301867 303861 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-03-17 02:31 UTC by Amos Shapira
Modified: 2010-01-24 01:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
check for null pointers (742 bytes, patch)
2006-07-29 17:13 UTC, Kevin Bauder
none Details | Review
check for null pointers (761 bytes, patch)
2006-07-29 17:25 UTC, Kevin Bauder
none Details | Review
check for null pointers (708 bytes, patch)
2006-07-29 17:37 UTC, Kevin Bauder
accepted-commit_now Details | Review
validate pointers in parsing routine (1.34 KB, patch)
2006-07-30 00:30 UTC, Kevin Bauder
none Details | Review

Description Amos Shapira 2005-03-17 02:31:59 UTC
Steps to reproduce:
My workplace was the target of a DDoS attack which slowed our link to a crowl,
the link officially was still up but virtually it was impossible to send or
recieve data through it.
After a while of this (possibly the first time gweather tried to connect)
gweather crashed.


Stack trace:
I don't have a stack trace right now

Other information:
System is a debian testting on a dual-cpu intel pentium 4. I was logged in for
weeks when it happened.
Comment 1 Sean D. Quinn 2005-03-17 02:37:03 UTC
Thank you for your bug report. I don't know if this is a GNOME problem within
gweather itself, or in the fact that the DDoS attack slowed your bandwidth down
so much and basically crippled your DNS servers so that the "connection" was
still up, but no data could be sent out/in. Now, what do you mean gweather
crashed? Did it come up with an "ended unexpectedly" notice or did it just not
receive weather data?

This is my first bug on GNOME BugZilla (Hey.) and I'm trying to make sure I can
understand the bug before I can triage it. Much thanks.

Comment 2 Amos Shapira 2005-03-17 02:49:58 UTC
I got the typical "Ended unexpecatdly" window with "report with bug-buddy"
(para-phrasing).  At the time I couldn't report (because the network was down)
so I didn't do it "properly" via bug-buddy.

To be clear - the application crashed and disappeared from the gnome panel,
and this happened after weeks of smooth operation.

The application is on the (default?) "update every 30 minutes" so I have a
strong feeling that this happened when on its first attempt to update during the
DDoS attack (which took an hour).

Thanks for handling this bug, please let me know if I can help further.
Comment 3 Sean D. Quinn 2005-03-17 03:02:50 UTC
No, thank you. The only thing I can gander at potentially being the problem is
the DNS. 
Comment 4 Danielle Madeley 2005-03-20 04:24:37 UTC
I think this might be the transient crash that seems to exist in gweather. The
one that I can't reliably reproduce.
Comment 5 James Henstridge 2005-04-26 23:23:32 UTC
*** Bug 301867 has been marked as a duplicate of this bug. ***
Comment 6 James Henstridge 2005-04-26 23:29:08 UTC
Retitling the bug report.  Some or all of the gweather screen scrapers are not
robust against unexpected input.

The transparent proxy here seemed to reliably crash gweather by returning a
login page when gweather was expecting weather data.

This should be pretty easy to test for by changing the URLs gweather uses to
something else and seeing what happens.
Comment 7 Danielle Madeley 2005-12-21 06:00:22 UTC
Marking this as a possible gnome-love bug.
Comment 8 Danielle Madeley 2005-12-21 07:15:32 UTC
*** Bug 303861 has been marked as a duplicate of this bug. ***
Comment 9 Danielle Madeley 2005-12-21 08:21:55 UTC
*** Bug 301805 has been marked as a duplicate of this bug. ***
Comment 10 Daniel Holbach 2006-07-27 14:20:53 UTC
Mentioned in https://launchpad.net/products/gnome-applets/+bug/54132 with 2.14.2 as well, bumping Version.
Comment 11 Sebastien Bacher 2006-07-29 13:50:30 UTC
debug backtrace from the Ubuntu bug:

"Backtrace was generated from '/usr/libexec/gweather'

Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1223660640 (LWP 5579)]
0xffffe410 in __kernel_vsyscall ()
  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #3 <signal handler called>
  • #4 strstr
    from /lib/tls/i686/cmov/libc.so.6
  • #5 bom_finish_read
    at weather-bom.c line 27
  • #6 gnome_vfs_job_get_count
    from /usr/lib/libgnomevfs-2.so.0
  • #7 g_child_watch_add
    from /usr/lib/libglib-2.0.so.0
  • #8 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0

Comment 12 Kevin Bauder 2006-07-29 17:13:09 UTC
Created attachment 69884 [details] [review]
check for null pointers

This patch fixes various possible pointer issues throughout the routine bom_parse.
Comment 13 Kevin Bauder 2006-07-29 17:25:17 UTC
Created attachment 69885 [details] [review]
check for null pointers

oops, posted the wrong one
Comment 14 Kevin Bauder 2006-07-29 17:37:38 UTC
Created attachment 69886 [details] [review]
check for null pointers

er, will the real patch please stand up. I've got it under control now. This is the last one I'm posting. I appologize for the mess. :)
Comment 15 Danielle Madeley 2006-07-29 17:43:53 UTC
Looks pretty good. We should put HEAD and gnome-2-14.

BOM code is Australia specific. There are likely to be other errors around too. Some of these have been hidden in duplicates, eg. #317206.
Comment 16 Kevin Bauder 2006-07-29 18:32:51 UTC
Yes, I tested it using Australian locations. I agree there could be others like this too. I had a quick look but admittedly haven't spent much time with it yet, but I will.
Comment 17 Kevin Bauder 2006-07-30 00:30:31 UTC
Created attachment 69897 [details] [review]
validate pointers in parsing routine

Davyd, here's another fix. This time in weather-met.c in the routine met_parse. I've applied the same treatment as the patch I provided for bom_parse. I don't know for sure if this was the cause to the other bugs duped to this one, but the bt for #317206 does point to metoffice_start_open which is in the same module as met_parse.
Comment 18 Danielle Madeley 2006-07-31 14:28:47 UTC
Comment on attachment 69897 [details] [review]
validate pointers in parsing routine


>-static gchar *met_parse (gchar *meto, WeatherLocation *loc)
>+static gchar *met_parse (gchar *meto)

Why break this API?
Comment 19 Danielle Madeley 2006-07-31 14:30:40 UTC
Actually, ignore me. I just realised this was a static. Need more coffee it seems.
Comment 20 Danielle Madeley 2006-07-31 15:18:32 UTC
Comment on attachment 69886 [details] [review]
check for null pointers

Committed to gnome-2-14 and in 2.14.3.
Comment 21 Danielle Madeley 2006-08-07 02:08:09 UTC
*** Bug 172198 has been marked as a duplicate of this bug. ***
Comment 22 Danielle Madeley 2006-08-07 14:06:12 UTC
2006-08-07  Davyd Madeley  <davyd@madeley.id.au>

        * weather-bom.c:
        * weather-met.c:
        - catch possible NULL pointers when parsing strings. Patches from
          Kevin Bauder <kevin.bauder@gmail.com>. Closes #170628.