* [PATCH] fixing crash in irmc.c when vcard=0
@ 2011-07-15 7:20 zheng wu
2011-07-26 9:29 ` Johan Hedberg
0 siblings, 1 reply; 5+ messages in thread
From: zheng wu @ 2011-07-15 7:20 UTC (permalink / raw)
To: linux-bluetooth; +Cc: zheng wu
When using sync profile, if getting the number of vcard is 0 in server,obexd will crash.
The reason is that the null point is used in query_result of irmc.c.The patch is for fixing it.
Signed-off-by: wu.zheng@intel.com
---
plugins/irmc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/plugins/irmc.c b/plugins/irmc.c
index 0fb92be..2ecae21 100644
--- a/plugins/irmc.c
+++ b/plugins/irmc.c
@@ -167,6 +167,8 @@ static void query_result(const char *buffer, size_t bufsize, int vcards,
else
irmc->buffer = g_string_append(irmc->buffer, owner_vcard);
+ if (buffer == NULL)
+ goto finish;
/* loop around buffer and add X-IRMC-LUID attribs */
s = buffer;
while ((t = strstr(s, "UID:")) != NULL) {
@@ -189,7 +191,7 @@ static void query_result(const char *buffer, size_t bufsize, int vcards,
}
/* add remaining bit of buffer */
irmc->buffer = g_string_append(irmc->buffer, s);
-
+finish:
obex_object_set_io_flags(irmc, G_IO_IN, 0);
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fixing crash in irmc.c when vcard=0
2011-07-15 7:20 zheng wu
@ 2011-07-26 9:29 ` Johan Hedberg
2011-07-27 3:05 ` Zheng, Wu
0 siblings, 1 reply; 5+ messages in thread
From: Johan Hedberg @ 2011-07-26 9:29 UTC (permalink / raw)
To: zheng wu; +Cc: linux-bluetooth
Hi,
On Fri, Jul 15, 2011, zheng wu wrote:
> When using sync profile, if getting the number of vcard is 0 in server,obexd will crash.
> The reason is that the null point is used in query_result of irmc.c.The patch is for fixing it.
> Signed-off-by: wu.zheng@intel.com
> ---
> plugins/irmc.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
The patch itself seems ok to me, but you need to fix your git settings:
1. Don't use Signed-off-by (this is only used for kernel patches).
2. Format your commit message lines to max 72 characters
3. Fix your git author name (first letter capitalized, etc.)
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] fixing crash in irmc.c when vcard=0
2011-07-26 9:29 ` Johan Hedberg
@ 2011-07-27 3:05 ` Zheng, Wu
0 siblings, 0 replies; 5+ messages in thread
From: Zheng, Wu @ 2011-07-27 3:05 UTC (permalink / raw)
To: Hedberg, Johan; +Cc: linux-bluetooth@vger.kernel.org
Hi Johan:
For your comments, I will send the patch again after modifying git settings.
Best regards
Zheng wu
> -----Original Message-----
> From: Johan Hedberg [mailto:johan.hedberg@intel.com]
> Sent: Tuesday, July 26, 2011 5:29 PM
> To: Zheng, Wu
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH] fixing crash in irmc.c when vcard=0
>
> Hi,
>
> On Fri, Jul 15, 2011, zheng wu wrote:
> > When using sync profile, if getting the number of vcard is 0 in
> server,obexd will crash.
> > The reason is that the null point is used in query_result of
> irmc.c.The patch is for fixing it.
> > Signed-off-by: wu.zheng@intel.com
> > ---
> > plugins/irmc.c | 4 +++-
> > 1 files changed, 3 insertions(+), 1 deletions(-)
>
> The patch itself seems ok to me, but you need to fix your git settings:
>
> 1. Don't use Signed-off-by (this is only used for kernel patches).
> 2. Format your commit message lines to max 72 characters
> 3. Fix your git author name (first letter capitalized, etc.)
>
> Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] fixing crash in irmc.c when vcard=0
@ 2011-07-27 3:05 Zheng Wu
2011-07-27 7:55 ` Johan Hedberg
0 siblings, 1 reply; 5+ messages in thread
From: Zheng Wu @ 2011-07-27 3:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Zheng Wu
If getting the number of vcard is 0 in sync server, obexd will crash.
The reason is that null point is used in query_result of irmc.c.
---
plugins/irmc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/plugins/irmc.c b/plugins/irmc.c
index 0fb92be..2ecae21 100644
--- a/plugins/irmc.c
+++ b/plugins/irmc.c
@@ -167,6 +167,8 @@ static void query_result(const char *buffer, size_t bufsize, int vcards,
else
irmc->buffer = g_string_append(irmc->buffer, owner_vcard);
+ if (buffer == NULL)
+ goto finish;
/* loop around buffer and add X-IRMC-LUID attribs */
s = buffer;
while ((t = strstr(s, "UID:")) != NULL) {
@@ -189,7 +191,7 @@ static void query_result(const char *buffer, size_t bufsize, int vcards,
}
/* add remaining bit of buffer */
irmc->buffer = g_string_append(irmc->buffer, s);
-
+finish:
obex_object_set_io_flags(irmc, G_IO_IN, 0);
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fixing crash in irmc.c when vcard=0
2011-07-27 3:05 [PATCH] fixing crash in irmc.c when vcard=0 Zheng Wu
@ 2011-07-27 7:55 ` Johan Hedberg
0 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2011-07-27 7:55 UTC (permalink / raw)
To: Zheng Wu; +Cc: linux-bluetooth
Hi,
On Wed, Jul 27, 2011, Zheng Wu wrote:
> If getting the number of vcard is 0 in sync server, obexd will crash.
> The reason is that null point is used in query_result of irmc.c.
> ---
> plugins/irmc.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
Applied after a couple of minor cosmetic fixes. Thanks.
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-07-27 7:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-27 3:05 [PATCH] fixing crash in irmc.c when vcard=0 Zheng Wu
2011-07-27 7:55 ` Johan Hedberg
-- strict thread matches above, loose matches on Subject: below --
2011-07-15 7:20 zheng wu
2011-07-26 9:29 ` Johan Hedberg
2011-07-27 3:05 ` Zheng, Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).