a40c6b4 KCM: Use json_loadb() when dealing with sss_iobuf data

1 file Authored by fidencio 10 months ago , Committed by jhrozek 10 months ago ,
    KCM: Use json_loadb() when dealing with sss_iobuf data
    As sss_iobuf data is *non* NULL terminated, we have to use json_loadb()
    passing the data's length instead of just using json_loads().
    Due to this issue, when running sssd-kcm under valgrind and performing a
    `kinit foo` a bunch of erros like the following one could be seen:
    ==2638== Conditional jump or move depends on uninitialised value(s)
    ==2638==    at 0x57DB678: stream_get.part.3 (load.c:172)
    ==2638==    by 0x57DB9CA: stream_get (load.c:643)
    ==2638==    by 0x57DB9CA: lex_get (load.c:246)
    ==2638==    by 0x57DB9CA: lex_scan (load.c:601)
    ==2638==    by 0x57DC56A: parse_json.constprop.7 (load.c:904)
    ==2638==    by 0x57DC6AB: json_loads (load.c:959)
    ==2638==    by 0x11ABEA: ??? (in /usr/libexec/sssd/sssd_kcm)
    ==2638==    by 0x11AEF0: ??? (in /usr/libexec/sssd/sssd_kcm)
    ==2638==    by 0x125D4A: ??? (in /usr/libexec/sssd/sssd_kcm)
    ==2638==    by 0x12623B: ??? (in /usr/libexec/sssd/sssd_kcm)
    ==2638==    by 0x9BCD71F: epoll_event_loop (tevent_epoll.c:728)
    ==2638==    by 0x9BCD71F: epoll_event_loop_once (tevent_epoll.c:930)
    ==2638==    by 0x9BCBBA6: std_event_loop_once (tevent_standard.c:114)
    ==2638==    by 0x9BC7FEC: _tevent_loop_once (tevent.c:725)
    ==2638==    by 0x9BC820A: tevent_common_loop_wait (tevent.c:848)
    Related to:
    Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
    Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>