Fix stack-buffer-overflow 71/277071/1
authorInkyun Kil <inkyun.kil@samsung.com>
Thu, 30 Jun 2022 06:31:15 +0000 (15:31 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Thu, 30 Jun 2022 06:36:17 +0000 (15:36 +0900)
- gsize is unsigned long.

Change-Id: I5b46a18569b69de683c8b56b11dffff79515338f
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
lib/alarm-lib-dbus.c

index 7ace21d..7916b1b 100644 (file)
@@ -332,7 +332,7 @@ bundle *_send_alarm_get_appsvc_info(alarm_context_t context, alarm_id_t alarm_id
 notification_h _send_alarm_get_noti_info(alarm_context_t context, alarm_id_t alarm_id, int *error_code)
 {
        int return_code = -1;
-       int datalen;
+       gsize datalen;
        GVariant *noti_gv = NULL;
        GVariant *body = NULL;
        notification_h noti = NULL;
@@ -360,7 +360,7 @@ notification_h _send_alarm_get_noti_info(alarm_context_t context, alarm_id_t ala
                if (error_code)
                        *error_code = return_code;
        } else {
-               data = g_base64_decode(noti_data, (gsize *)&datalen);
+               data = g_base64_decode(noti_data, &datalen);
 
                noti_gv = g_variant_new_from_data(G_VARIANT_TYPE("(v)"),
                                data, datalen,