Fixed some minor parsing bugs:

code_attr offet was not updated correctly after reading the length of the attribute
attr_buf was not initialized correctly before use