• Denis Efremov's avatar
    ar5523: check NULL before memcpy() in ar5523_cmd() · 315cee42
    Denis Efremov authored
    memcpy() call with "idata == NULL && ilen == 0" results in undefined
    behavior in ar5523_cmd(). For example, NULL is passed in callchain
    "ar5523_stat_work() -> ar5523_cmd_write() -> ar5523_cmd()". This patch
    adds ilen check before memcpy() call in ar5523_cmd() to prevent an
    undefined behavior.
    
    Cc: Pontus Fuchs <pontus.fuchs@gmail.com>
    Cc: Kalle Valo <kvalo@codeaurora.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: David Laight <David.Laight@ACULAB.COM>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarDenis Efremov <efremov@linux.com>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    315cee42
ar5523.c 46.5 KB