Message ID | 1334909102-12784-1-git-send-email-kengyu@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 20/04/12 09:05, Keng-Yu Lin wrote: > On processing the final element (the 8-th) of the raw _WDG data, > the pointer is not incremented. This causes the loss of the final > element and incorrect parsing result. > > Signed-off-by: Keng-Yu Lin<kengyu@canonical.com> > --- > src/acpi/wmi/wmi.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/acpi/wmi/wmi.c b/src/acpi/wmi/wmi.c > index de353c6..5a188eb 100644 > --- a/src/acpi/wmi/wmi.c > +++ b/src/acpi/wmi/wmi.c > @@ -219,7 +219,10 @@ static void wmi_get_wdg_data(fwts_framework *fw, > str+=4; > if (*str != ',') break; > str++; > - if (!isspace(*str)) break; > + if (!isspace(*str)) { > + data++; > + break; > + } > str++; > data++; > if (data> wdg_data + size) { Well spotted. Thanks! Acked-by: Colin Ian King <colin.king@canonical.com>
On 04/20/2012 04:05 PM, Keng-Yu Lin wrote: > On processing the final element (the 8-th) of the raw _WDG data, > the pointer is not incremented. This causes the loss of the final > element and incorrect parsing result. > > Signed-off-by: Keng-Yu Lin<kengyu@canonical.com> > --- > src/acpi/wmi/wmi.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/acpi/wmi/wmi.c b/src/acpi/wmi/wmi.c > index de353c6..5a188eb 100644 > --- a/src/acpi/wmi/wmi.c > +++ b/src/acpi/wmi/wmi.c > @@ -219,7 +219,10 @@ static void wmi_get_wdg_data(fwts_framework *fw, > str+=4; > if (*str != ',') break; > str++; > - if (!isspace(*str)) break; > + if (!isspace(*str)) { > + data++; > + break; > + } > str++; > data++; > if (data> wdg_data + size) { Acked-by: Alex Hung <alex.hung@canonical.com>
diff --git a/src/acpi/wmi/wmi.c b/src/acpi/wmi/wmi.c index de353c6..5a188eb 100644 --- a/src/acpi/wmi/wmi.c +++ b/src/acpi/wmi/wmi.c @@ -219,7 +219,10 @@ static void wmi_get_wdg_data(fwts_framework *fw, str+=4; if (*str != ',') break; str++; - if (!isspace(*str)) break; + if (!isspace(*str)) { + data++; + break; + } str++; data++; if (data > wdg_data + size) {
On processing the final element (the 8-th) of the raw _WDG data, the pointer is not incremented. This causes the loss of the final element and incorrect parsing result. Signed-off-by: Keng-Yu Lin <kengyu@canonical.com> --- src/acpi/wmi/wmi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)