Fix potential invalid read past end of array
Fix potential invalid read past end of array

If array has N elements, we can't read +1 if we are already at N.

Also, we need to move elements by their storage size in the array,
not just by individual bytes.

fengshao0907/redis,ncopa/redis,jackyan/redis,brg-liuwei/redis,taoguan/redis,zhcy/redis,itamarhaber/redis,tjschuck/redis,MasahikoSawada/redis,kaushik94/redis,soloestoy/redis,csuhawk/redis,ouyangkongtong/redis,sunheehnus/redis,roth1002/redis,charsyam/redis,a-pavlov/redis,ncopa/redis,dreamquster/redis,allengaller/redis,seppo0010/redis,SummonY/redis,itugs/redis,Sciumo/redis,francischan714/redis,charsyam/redis,pedigree/redis,jackyan/redis,Markgorden/redis,allengaller/redis,Sciumo/redis,atreeyang/redis,zhiliaoniu/redis,hgl888/redis,CodeJuan/redis,PradheepShrinivasan/redis,alenslan/redis,allengaller/redis,wbailey5/redis,guker/redis,antirez/redis,zguangyu/redis,tjschuck/redis,dayuoba/redis,allengaller/redis,alenslan/redis,itamarhaber/redis,wenxueliu/redis_comment,fengshao0907/redis,Wangyao14cyy/redis,yossigo/redis,nnog/redis,pmem/redis,tellapart/redis,colstrom/redis,healerkx/redis,LongXQ/redis,Sciumo/redis,GitHubMota/redis,hgl888/redis,arijitvt/redis,francischan714/redis,hornen/redis,GrimDerp/redis,4396/redis,weizijun/redis,soloestoy/redis,Soledad89/redis,modulexcite/redis,pcarrier/redis,xujunhai1991/redis,mingyaaaa/redis,neomantra/redis,jingjidejuren/redis,tanghaodong25/redis,francischan714/redis,twskipper/redis,ErikDubbelboer/redis,itamarhaber/redis,ouyangkongtong/redis,taoguan/redis,wangyikai/redis,PradheepShrinivasan/redis,janekmi/redis,ctripcorp/redis,guker/redis,hedisdb/hedis,PradheepShrinivasan/redis,huyuezheng/redis,riyan8250/redis,GitHubMota/redis,roth1002/redis,guker/redis,RepmujNetsik/redis,RepmujNetsik/redis,hgl888/redis,roth1002/redis,atreeyang/redis,zhiliaoniu/redis,ituncle/redis,harrisonfeng/redis,timothyohare/3rdPartySrc-redis,dayuoba/redis,atreeyang/redis,supasate/redis,csuhawk/redis,francischan714/redis,atreeyang/redis,YuanZhewei/redis,pmem/redis,mcanthony/redis,ouyangkongtong/redis,izhoujie/redis,tanghaodong25/redis,tjschuck/redis,takeshineshiro/redis,supasate/redis,qiyang0221/redis,AALEKH/redis,spinlock/redis,hedisdb/hedis,pedigree/redis,programmecat/redis,clamoriniere1A/redis,SummonY/redis,hedisdb/hedis,cusspvz/redis,mgk/redis,NBSW/redis,PKRoma/redis,z-fork/redis,gaoxianglong/redis,seandsky/redis,cnbin/redis,saisai/redis,ctripcorp/redis,yuhc/redis-benchmark-enhanced,supasate/redis,izhoujie/redis,taoguan/redis,YuanZhewei/redis,blackmady/redis,zhcy/redis,vincent-vivian-liu/redis,YuraLukashik/redis,izhoujie/redis,aim-for-better/redis,xlzhan/redis,mingyaaaa/redis,timothyohare/3rdPartySrc-redis,cusspvz/redis,OmarQunsul/graph-redis,devaos/redis,AplayER/redis,rogerchina/redis,kensou97/redis,thomasdarimont/redis,JoeWoo/redis,sunheehnus/redis,YuraLukashik/redis,nnog/redis,twskipper/redis,OmarQunsul/graph-redis,xlzhan/redis,badboy/redis,wprice/redis,ton31337/redis,modulexcite/redis,rogerlz/redis,honestme/redis,universsky/redis,nuxeh/redis,xuguruogu/redis,valdsJohn/redis,ofirluzon/redis,sunheehnus/redis,ipmobiletech/redis,StevenTsai/redis,nuxeh/redis,dreamquster/redis,zhiliaoniu/redis,YongMan/redis,yuhc/redis-benchmark-enhanced,shreesundara/redis,ctripcorp/redis,pkdevbox/redis,thomasdarimont/redis,xujunhai1991/redis,iandyh/redis,mingyaaaa/redis,saisai/redis,clamoriniere1A/redis,pmem/redis,qiyang0221/redis,harrisonfeng/redis,mcanthony/redis,mumingv/redis,izhoujie/redis,neomantra/redis,tellapart/redis,LongXQ/redis,CodeJuan/redis,alenslan/redis,YongMan/redis,rogerchina/redis,wenxueliu/redis_comment,wenxueliu/redis_comment,holstvoogd/redis,healerkx/redis,4396/redis,elkingtonmcb/redis,shining-yang/redis,tanghaodong25/redis,netroby/redis,ytjiang/redis,honestme/redis,190235047/redis,jackyan/redis,AALEKH/redis,rouzier/redis,davidradunz/redis,h0x91b/redis,shreesundara/redis,saisai/redis,SummonY/redis,ouyangkongtong/redis,soveran/redis,weizijun/redis,simplestbest/redis,yossigo/redis,mverrilli/redis,ipmobiletech/redis,colstrom/redis,ytjiang/redis,pkdevbox/redis,flashbuckets/redis,guker/redis,a-pavlov/redis,dayuoba/redis,jasonkying/redis,harrisonfeng/redis,dreamquster/redis,cusspvz/redis,iandyh/redis,healerkx/redis,xlzhan/redis,arijitvt/redis,elkingtonmcb/redis,thomasdarimont/redis,shining-yang/redis,kmiku7/redis,valdsJohn/redis,JoeWoo/redis,wprice/redis,PKRoma/redis,july2993/redis,190235047/redis,rouzier/redis,StevenTsai/redis,Wangyao14cyy/redis,hawkchch/redis,janekmi/redis,clamoriniere1A/redis,xujunhai1991/redis,neomantra/redis,july2993/redis,july2993/redis,kmiku7/redis,ctripcorp/redis,charsyam/redis,PKRoma/redis,nnog/redis,zhcy/redis,linfangrong/redis,shining-yang/redis,190235047/redis,seppo0010/redis,qiyang0221/redis,oranagra/redis,programmecat/redis,zczhuohuo/redis,simplestbest/redis,spinlock/redis,honestme/redis,4396/redis,4396/redis,duanx/redis,programmecat/redis,mgk/redis,jasonkying/redis,Markgorden/redis,citusdata/redis,ncopa/redis,kmiku7/redis,netroby/redis,xuguruogu/redis,zguangyu/redis,riyan8250/redis,Sciumo/redis,takeshineshiro/redis,csuhawk/redis,zguangyu/redis,valdsJohn/redis,h0x91b/redis,dreamquster/redis,badboy/redis,StevenTsai/redis,itugs/redis,yuhc/redis-benchmark-enhanced,mcanthony/redis,modulexcite/redis,wenxueliu/redis_comment,oranagra/redis,antirez/redis,universsky/redis,honestme/redis,brg-liuwei/redis,huyuezheng/redis,JoeWoo/redis,rogerchina/redis,jingjidejuren/redis,davidradunz/redis,mumingv/redis,AALEKH/redis,cnbin/redis,rogerlz/redis,190235047/redis,zhiliaoniu/redis,dayuoba/redis,h0x91b/redis,soveran/redis,neomantra/redis,Markgorden/redis,spinlock/redis,taoguan/redis,wbailey5/redis,cloudrain21/redis,hornen/redis,YongMan/redis,pcarrier/redis,jasonkying/redis,seandsky/redis,riyan8250/redis,holstvoogd/redis,roth1002/redis,mengyou0304/redis,gaoxianglong/redis,simplestbest/redis,kensou97/redis,rogerchina/redis,YuanZhewei/redis,wangyikai/redis,itamarhaber/redis,duanx/redis,cloudrain21/redis,z-fork/redis,zczhuohuo/redis,devaos/redis,arijitvt/redis,seandsky/redis,linfangrong/redis,ErikDubbelboer/redis,seandsky/redis,ofirluzon/redis,kensou97/redis,kaushik94/redis,JoeWoo/redis,xuguruogu/redis,itugs/redis,hedisdb/hedis,oranagra/redis,SyntaxStacks/redis,kmiku7/redis,cloudrain21/redis,blackmady/redis,cloudrain21/redis,yuhc/redis-benchmark-enhanced,ytjiang/redis,valdsJohn/redis,PradheepShrinivasan/redis,yossigo/redis,hornen/redis,nnog/redis,PKRoma/redis,seppo0010/redis,kaushik94/redis,mverrilli/redis,rogerlz/redis,zczhuohuo/redis,Soledad89/redis,YuraLukashik/redis,citusdata/redis,oranagra/redis,fengshao0907/redis,wangyikai/redis,mverrilli/redis,vincent-vivian-liu/redis,hawkchch/redis,PKRoma/redis,mumingv/redis,pkdevbox/redis,colstrom/redis,takeshineshiro/redis,OmarQunsul/graph-redis,tjschuck/redis,ituncle/redis,modulexcite/redis,mcanthony/redis,LongXQ/redis,Aliceljm1/redis,badboy/redis,abhiklodh/redis,antirez/redis,devaos/redis,vincent-vivian-liu/redis,Soledad89/redis,blackmady/redis,xujunhai1991/redis,twskipper/redis,linfangrong/redis,weizijun/redis,timothyohare/3rdPartySrc-redis,ytjiang/redis,charsyam/redis,ncopa/redis,YongMan/redis,itugs/redis,zczhuohuo/redis,xlzhan/redis,abhiklodh/redis,GrimDerp/redis,thomasdarimont/redis,july2993/redis,brg-liuwei/redis,iandyh/redis,netroby/redis,LongXQ/redis,tellapart/redis,nuxeh/redis,gaoxianglong/redis,pedigree/redis,Wangyao14cyy/redis,MasahikoSawada/redis,aim-for-better/redis,pkdevbox/redis,ofirluzon/redis,wangyikai/redis,huyuezheng/redis,StevenTsai/redis,programmecat/redis,aim-for-better/redis,GrimDerp/redis,elkingtonmcb/redis,Aliceljm1/redis,csuhawk/redis,tanghaodong25/redis,hawkchch/redis,universsky/redis,soloestoy/redis,mengyou0304/redis,kensou97/redis,Aliceljm1/redis,rouzier/redis,abhiklodh/redis,devaos/redis,YuanZhewei/redis,RepmujNetsik/redis,a-pavlov/redis,YuraLukashik/redis,cusspvz/redis,jackyan/redis,nuxeh/redis,soveran/redis,saisai/redis,MasahikoSawada/redis,abhiklodh/redis,RepmujNetsik/redis,sunheehnus/redis,Wangyao14cyy/redis,GitHubMota/redis,cnbin/redis,z-fork/redis,xuguruogu/redis,holstvoogd/redis,z-fork/redis,takeshineshiro/redis,alenslan/redis,hawkchch/redis,pmem/redis,oranagra/redis,healerkx/redis,shreesundara/redis,tellapart/redis,jasonkying/redis,SyntaxStacks/redis,davidradunz/redis,harrisonfeng/redis,timothyohare/3rdPartySrc-redis,duanx/redis,qiyang0221/redis,ton31337/redis,elkingtonmcb/redis,kaushik94/redis,wprice/redis,mverrilli/redis,Markgorden/redis,holstvoogd/redis,arijitvt/redis,zguangyu/redis,seppo0010/redis,badboy/redis,citusdata/redis,a-pavlov/redis,flashbuckets/redis,AplayER/redis,NBSW/redis,twskipper/redis,wbailey5/redis,AplayER/redis,flashbuckets/redis,gaoxianglong/redis,jingjidejuren/redis,CodeJuan/redis,wprice/redis,mumingv/redis,shreesundara/redis,SummonY/redis,yossigo/redis,zhcy/redis,OmarQunsul/graph-redis,janekmi/redis,janekmi/redis,ofirluzon/redis,SyntaxStacks/redis,colstrom/redis,MasahikoSawada/redis,GrimDerp/redis,rouzier/redis,NBSW/redis,ErikDubbelboer/redis,davidradunz/redis,clamoriniere1A/redis,mgk/redis,ipmobiletech/redis,netroby/redis,rogerlz/redis,cnbin/redis,mingyaaaa/redis,vincent-vivian-liu/redis,ErikDubbelboer/redis,mengyou0304/redis,flashbuckets/redis,soveran/redis,ituncle/redis,spinlock/redis,antirez/redis,yossigo/redis,soloestoy/redis,soloestoy/redis,brg-liuwei/redis,wbailey5/redis,NBSW/redis,supasate/redis,GitHubMota/redis,riyan8250/redis,blackmady/redis,ton31337/redis,universsky/redis,neomantra/redis,jingjidejuren/redis,hornen/redis,hgl888/redis,ton31337/redis,charsyam/redis,Soledad89/redis,SyntaxStacks/redis,huyuezheng/redis,duanx/redis,ipmobiletech/redis,Aliceljm1/redis,CodeJuan/redis,shining-yang/redis,linfangrong/redis,citusdata/redis,fengshao0907/redis,pcarrier/redis,weizijun/redis,aim-for-better/redis,mgk/redis,pcarrier/redis,mengyou0304/redis,ituncle/redis,pedigree/redis,iandyh/redis,AplayER/redis,AALEKH/redis,h0x91b/redis,simplestbest/redis,ofirluzon/redis