avutil/avstring: Fix bug and undefined behavior in av_strncasecmp()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 15 Apr 2019 22:09:38 +0000 (00:09 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 9 May 2019 09:21:57 +0000 (11:21 +0200)
commit3905acef67e04578691d0bf15fa7111496c803d7
tree046cf7104361baef0baf30982b1780a0416af8fa
parentd2035634943f82dfebccb52fe47692c1890c208e
avutil/avstring: Fix bug and undefined behavior in av_strncasecmp()

The function in case of n=0 would read more bytes than 0.
The end pointer could be beyond the allocated space, which
is undefined.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6f0e9a863466bfcbd75ee15d4d8a6aad2a5126a4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavutil/avstring.c