Fix crash if we get an EOF after a large packet with unterminated headers. Make sure we always start copying excess data to the start of the read buffer, even in the case where save_amount==0 and additional_save_amount!=0
Fix crash if we get an EOF after a large packet with unterminated headers.
Make sure we always start copying excess data to the start of the read buffer, even in the case where save_amount==0 and additional_save_amount!=0

BUG=27509
TEST=NONE

Review URL: http://codereview.chromium.org/385088

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@31939 0039d316-1c4b-4281-b951-d872f2087c98

TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,ltilve/chromium,ltilve/chromium,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,nacl-webkit/chrome_deps,dednal/chromium.src,dednal/chromium.src,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,robclark/chromium,zcbenz/cefode-chromium,anirudhSK/chromium,robclark/chromium,patrickm/chromium.src,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,Chilledheart/chromium,robclark/chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,Chilledheart/chromium,ltilve/chromium,Chilledheart/chromium,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,ondra-novak/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,anirudhSK/chromium,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,robclark/chromium,markYoungH/chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,Just-D/chromium-1,jaruba/chromium.src,fujunwei/chromium-crosswalk,keishi/chromium,mohamed--abdel-maksoud/chromium.src,rogerwang/chromium,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,keishi/chromium,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,robclark/chromium,jaruba/chromium.src,Fireblend/chromium-crosswalk,patrickm/chromium.src,robclark/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,robclark/chromium,markYoungH/chromium.src,keishi/chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,M4sse/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,Chilledheart/chromium,rogerwang/chromium,M4sse/chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,Pluto-tv/chromium-crosswalk,rogerwang/chromium,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,jaruba/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,timopulkkinen/BubbleFish,Chilledheart/chromium,rogerwang/chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,nacl-webkit/chrome_deps,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,Jonekee/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,rogerwang/chromium,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,jaruba/chromium.src,Chilledheart/chromium,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,keishi/chromium,patrickm/chromium.src,littlstar/chromium.src,patrickm/chromium.src,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,ondra-novak/chromium.src,Just-D/chromium-1,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,rogerwang/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,keishi/chromium,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,nacl-webkit/chrome_deps,keishi/chromium,ltilve/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,rogerwang/chromium,littlstar/chromium.src,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,robclark/chromium,rogerwang/chromium,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,M4sse/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,jaruba/chromium.src,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,robclark/chromium,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,keishi/chromium,nacl-webkit/chrome_deps,hujiajie/pa-chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,ondra-novak/chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,dednal/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,robclark/chromium,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,ltilve/chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,ondra-novak/chromium.src,dednal/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,Chilledheart/chromium,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,anirudhSK/chromium,M4sse/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,M4sse/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,mogoweb/chromium-crosswalk,keishi/chromium,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,dushu1203/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,rogerwang/chromium,littlstar/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,dednal/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,nacl-webkit/chrome_deps,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,Jonekee/chromium.src,dednal/chromium.src,jaruba/chromium.src,keishi/chromium,zcbenz/cefode-chromium