php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76762 protobuf int32默认值导致js解析失败
Submitted: 2018-08-18 08:52 UTC Modified: 2021-08-26 11:04 UTC
From: 1339796113 at qq dot com Assigned: cmb (profile)
Status: Closed Package: PECL (PECL)
PHP Version: 7.2.9 OS: linux
Private report: No CVE-ID: None
 [2018-08-18 08:52 UTC] 1339796113 at qq dot com
Description:
------------
int32 默认值0 map<int32, int64> 当map类型计算长度的时候由于int32 默认值为0  map的key为0时 导致计算长度不一样
 T(UPB_TYPE_FLOAT, float, float, 0.0)
    T(UPB_TYPE_DOUBLE, double, double, 0.0)
    T(UPB_TYPE_BOOL, bool, uint8_t, 0)
    T(UPB_TYPE_ENUM, int32, int32_t, 0)
    T(UPB_TYPE_INT32, int32, int32_t, -1)
    T(UPB_TYPE_UINT32, uint32, uint32_t, 0)
    T(UPB_TYPE_INT64, int64, int64_t, 0)
    T(UPB_TYPE_UINT64, uint64, uint64_t, 0)
encode_decode.c 1127行   T(UPB_TYPE_INT32, int32, int32_t, -1) 修改为这个即可


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-18 10:02 UTC] cmb@php.net
-Package: *Web Server problem +Package: PECL
 [2021-08-26 11:04 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-08-26 11:04 UTC] cmb@php.net
If this is still unresolved, please report it at
<https://github.com/protocolbuffers/protobuf/issues>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC