Compare commits

...

3 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa e24e29ff14 Bump up version number to 0.3.2; LT revision to 2:2:0 2014-02-26 23:52:38 +09:00
Tatsuhiro Tsujikawa 2f23eac179 nghttp2_hd: Fail inflate immediately if ctx.bad is nonzero
Doing inflation after error produces invalid results, especially, if
it is in NGHTTP2_HD_STATE_READ_INDEX, the inflater->left could be 0,
which causes assertion error.  Add sanity assertion for index
2014-02-26 23:36:28 +09:00
Tatsuhiro Tsujikawa b3f6664bc6 nghttp2_hd: Fix integer decoding bug 2014-02-26 23:36:28 +09:00
2 changed files with 11 additions and 6 deletions

View File

@ -21,13 +21,13 @@ dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AC_PREREQ(2.61)
AC_INIT([nghttp2], [0.3.1], [t-tujikawa@users.sourceforge.net])
AC_INIT([nghttp2], [0.3.2], [t-tujikawa@users.sourceforge.net])
LT_PREREQ([2.2.6])
LT_INIT()
dnl See versioning rule:
dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
AC_SUBST(LT_CURRENT, 2)
AC_SUBST(LT_REVISION, 1)
AC_SUBST(LT_REVISION, 2)
AC_SUBST(LT_AGE, 0)
major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`

View File

@ -531,11 +531,11 @@ static uint8_t* decode_length(ssize_t *res, int *final, ssize_t initial,
*final = 1;
return in + 1;
}
}
if(++in == last) {
*res = n;
return in;
}
}
for(r = 0; in != last; ++in, r += 7) {
n += (*in & 0x7f) << r;
if(n >= (1 << 16)) {
@ -1412,6 +1412,10 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
uint8_t *last = in + inlen;
int rfin = 0;
if(inflater->ctx.bad) {
return NGHTTP2_ERR_HEADER_COMP;
}
DEBUGF(fprintf(stderr, "nghtp2_hd_infalte_hd start state=%d\n",
inflater->state));
hd_inflate_keep_free(inflater);
@ -1477,6 +1481,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
}
} else {
inflater->index = inflater->left;
assert(inflater->index > 0);
--inflater->index;
inflater->ent_name = nghttp2_hd_table_get(&inflater->ctx,
inflater->index);