Fix overflow when encoding a dense NDV string
Fix overflow when encoding a dense NDV string

EncodeNdv() checks to see if writing a C,V pair will overflow the output
string. However, the output string was incorrectly initially sized two
bytes too small, which could lead to the encoder writing two bytes past
the end of the buffer before realising that the encoded string would be
too long and aborting.

Change-Id: Ic65610460ff82cc000a4a5356b1b06931deb1bc4
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5432
Reviewed-by: Alex Behm <fe1626037acfc2dc542d2aa723a6d14f2464a20c@cloudera.com>
Tested-by: jenkins

ImpalaToGo/ImpalaToGo,cgvarela/Impala,bratatidas9/Impala-1,bratatidas9/Impala-1,brightchen/Impala,XiaominZhang/Impala,grundprinzip/Impala,rdblue/Impala,gerashegalov/Impala,lirui-intel/Impala,kapilrastogi/Impala,bratatidas9/Impala-1,henryr/Impala,XiaominZhang/Impala,lnliuxing/Impala,rdblue/Impala,cloudera/recordservice,henryr/Impala,kapilrastogi/Impala,bowlofstew/Impala,XiaominZhang/Impala,tempbottle/Impala,caseyching/Impala,ImpalaToGo/ImpalaToGo,brightchen/Impala,bowlofstew/Impala,placrosse/ImpalaToGo,cloudera/recordservice,theyaa/Impala,tempbottle/Impala,caseyching/Impala,grundprinzip/Impala,kapilrastogi/Impala,rdblue/Impala,bratatidas9/Impala-1,ImpalaToGo/ImpalaToGo,lirui-intel/Impala,cgvarela/Impala,gerashegalov/Impala,theyaa/Impala,cgvarela/Impala,cloudera/recordservice,henryr/Impala,XiaominZhang/Impala,lirui-intel/Impala,brightchen/Impala,cchanning/Impala,kapilrastogi/Impala,placrosse/ImpalaToGo,kapilrastogi/Impala,scalingdata/Impala,gerashegalov/Impala,tempbottle/Impala,grundprinzip/Impala,caseyching/Impala,bratatidas9/Impala-1,brightchen/Impala,theyaa/Impala,cgvarela/Impala,cchanning/Impala,cloudera/recordservice,lnliuxing/Impala,henryr/Impala,tempbottle/Impala,placrosse/ImpalaToGo,gerashegalov/Impala,lnliuxing/Impala,caseyching/Impala,kapilrastogi/Impala,theyaa/Impala,scalingdata/Impala,lirui-intel/Impala,lnliuxing/Impala,placrosse/ImpalaToGo,grundprinzip/Impala,lirui-intel/Impala,placrosse/ImpalaToGo,bratatidas9/Impala-1,caseyching/Impala,gerashegalov/Impala,lnliuxing/Impala,grundprinzip/Impala,ImpalaToGo/ImpalaToGo,cchanning/Impala,ImpalaToGo/ImpalaToGo,caseyching/Impala,lirui-intel/Impala,grundprinzip/Impala,bowlofstew/Impala,caseyching/Impala,cgvarela/Impala,bowlofstew/Impala,theyaa/Impala,tempbottle/Impala,theyaa/Impala,brightchen/Impala,cchanning/Impala,placrosse/ImpalaToGo,theyaa/Impala,tempbottle/Impala,tempbottle/Impala,gerashegalov/Impala,scalingdata/Impala,lnliuxing/Impala,henryr/Impala,lnliuxing/Impala,XiaominZhang/Impala,brightchen/Impala,scalingdata/Impala,lirui-intel/Impala,cloudera/recordservice,ImpalaToGo/ImpalaToGo,XiaominZhang/Impala,rdblue/Impala,henryr/Impala,cgvarela/Impala,scalingdata/Impala,gerashegalov/Impala,scalingdata/Impala,bowlofstew/Impala,rdblue/Impala,cloudera/recordservice,cloudera/recordservice,kapilrastogi/Impala,bowlofstew/Impala,cchanning/Impala,bratatidas9/Impala-1,rdblue/Impala,bowlofstew/Impala,rdblue/Impala,cchanning/Impala,cgvarela/Impala,brightchen/Impala,cchanning/Impala,XiaominZhang/Impala