[msitools: 2/6] libmsi: treat property as invalid if str len is 0
- From: Marc-André Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [msitools: 2/6] libmsi: treat property as invalid if str len is 0
- Date: Tue, 16 Mar 2021 11:16:09 +0000 (UTC)
commit 7a5c88906c9383d6cc9200a9d402e9977f2ef99c
Author: Marc-André Lureau <marcandre lureau redhat com>
Date: Tue Mar 16 12:52:55 2021 +0400
libmsi: treat property as invalid if str len is 0
Fixes #34 "Integer overflow in read_properties_from_data"
Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>
libmsi/libmsi-summary-info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libmsi/libmsi-summary-info.c b/libmsi/libmsi-summary-info.c
index 27b1e2e..2ecc4f8 100644
--- a/libmsi/libmsi-summary-info.c
+++ b/libmsi/libmsi-summary-info.c
@@ -372,7 +372,7 @@ static void read_properties_from_data( LibmsiOLEVariant *prop, const uint8_t *da
break;
case OLEVT_LPSTR:
len = read_dword(data, &dwOffset);
- if( dwOffset + len > sz )
+ if(len == 0 || dwOffset + len > sz )
{
g_critical("not enough data for type %d %d %d \n", dwOffset, len, sz);
valid = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]