summaryrefslogtreecommitdiff
path: root/src/dkp-wup.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2008-11-07 13:15:40 +0000
committerRichard Hughes <richard@hughsie.com>2008-11-07 13:15:40 +0000
commit7d87461bb3adb59588c8b80f747937058b76489c (patch)
treec16e86e3e23243b30f9539b0a31078dd4238c1aa /src/dkp-wup.c
parent885c3e474898b641f23d365688aa77852345996a (diff)
more trivial WUP fixes
Diffstat (limited to 'src/dkp-wup.c')
-rw-r--r--src/dkp-wup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dkp-wup.c b/src/dkp-wup.c
index 519310c..7e006af 100644
--- a/src/dkp-wup.c
+++ b/src/dkp-wup.c
@@ -254,8 +254,14 @@ dkp_wup_parse_command (DkpWup *wup, const gchar *data)
* \-----/
* so try to find the start and the end */
- /* strip to the first '#' char */
+ /* ensure we have a long enough response */
length = strlen (data);
+ if (length < 3) {
+ egg_debug ("not enough data '%s'", data);
+ goto out;
+ }
+
+ /* strip to the first '#' char */
for (i=0; i<length-1; i++)
if (data[i] == '#')
packet = g_strdup (data+i);