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, 27 Jun 2019 15:50:47 +0000 (17:50 +0200)
commitd8bdc954579b0bb2e2b34d19e8cf3ff3d6201601
tree977bbdc811cfb0ee941d1cb857bfead6114911e9
parent05a90821d05f88bd0a290878d1aa2c459aed67ac
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