[libsoup] tests: sniffing: Avoid loop with uninitialised length
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] tests: sniffing: Avoid loop with uninitialised length
- Date: Wed, 8 Feb 2012 10:09:06 +0000 (UTC)
commit acea05b62d360a3eab638b45bdd8ced247702bcc
Author: Robert Swain <robert swain collabora co uk>
Date: Tue Jan 31 13:58:56 2012 +0100
tests: sniffing: Avoid loop with uninitialised length
[This would only happen if a request was made to an unhandled path,
which this test doesn't do, but it seems reasonable to return an empty
response rather than crashing. -smcv]
Reviewed-by: Simon McVittie <simon mcvittie collabora co uk>
Reviewed-by: Dan Winship <danw gnome org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
Bug-NB: NB#297634
tests/sniffing-test.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tests/sniffing-test.c b/tests/sniffing-test.c
index 828f1d5..2812334 100644
--- a/tests/sniffing-test.c
+++ b/tests/sniffing-test.c
@@ -23,7 +23,7 @@ server_callback (SoupServer *server, SoupMessage *msg,
GError *error = NULL;
char *query_key;
char *contents;
- gsize length, offset;
+ gsize length = 0, offset;
gboolean empty_response = FALSE;
if (msg->method != SOUP_METHOD_GET) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]