Loading src/api.cpp +6 −7 Changes for src/api.cpp: 6 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -277,16 +277,13 @@ public: std::shared_ptr<authdb::AuthData::Record> cur = std::make_shared<authdb::AuthData::Record>(); while (rd < end) { while (rd + sizeof(AuthData::Record) <= end) { _Backend.setPos(rd); // read header of record (API returns void) _Backend.read(reinterpret_cast<unsigned char*>(cur.get()), sizeof(AuthData::Record)); // header_end_pos is at current backend position after reading header size_t header_end_pos = _Backend.getPos(); // Validate and compute next rd using cur->datasize if (!compute_next_rd(rd, end, cur->datasize, header_end_pos)) { break; } Loading Loading @@ -343,7 +340,7 @@ public: size_t rd = sizeof(authdb::AuthHeader); size_t end = _Backend.end(); while (rd < end) { while (rd + sizeof(AuthData::Record) <= end) { std::shared_ptr<authdb::AuthData::Record> cur = std::make_shared<authdb::AuthData::Record>(); _Backend.setPos(rd); Loading Loading @@ -698,11 +695,13 @@ public: Group group; size_t rd = sizeof(authdb::AuthHeader), end = _Backend.end(); while (rd < end) { while (rd + sizeof(AuthData::Record) <= end) { std::shared_ptr<authdb::AuthData::Record> cur = std::make_shared<authdb::AuthData::Record>(); _Backend.setPos(rd); _Backend.read((unsigned char*)cur.get(), sizeof(AuthData::Record)); rd = _Backend.getPos() + cur->datasize; size_t next = _Backend.getPos() + cur->datasize; if (next < _Backend.getPos() || next > end) break; rd = next; if (cur->type == GroupData && strcmp(cur->fieldname, "groupname") == 0) { class GroupData gdat(cur->ruid); Loading Loading
src/api.cpp +6 −7 Changes for src/api.cpp: 6 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -277,16 +277,13 @@ public: std::shared_ptr<authdb::AuthData::Record> cur = std::make_shared<authdb::AuthData::Record>(); while (rd < end) { while (rd + sizeof(AuthData::Record) <= end) { _Backend.setPos(rd); // read header of record (API returns void) _Backend.read(reinterpret_cast<unsigned char*>(cur.get()), sizeof(AuthData::Record)); // header_end_pos is at current backend position after reading header size_t header_end_pos = _Backend.getPos(); // Validate and compute next rd using cur->datasize if (!compute_next_rd(rd, end, cur->datasize, header_end_pos)) { break; } Loading Loading @@ -343,7 +340,7 @@ public: size_t rd = sizeof(authdb::AuthHeader); size_t end = _Backend.end(); while (rd < end) { while (rd + sizeof(AuthData::Record) <= end) { std::shared_ptr<authdb::AuthData::Record> cur = std::make_shared<authdb::AuthData::Record>(); _Backend.setPos(rd); Loading Loading @@ -698,11 +695,13 @@ public: Group group; size_t rd = sizeof(authdb::AuthHeader), end = _Backend.end(); while (rd < end) { while (rd + sizeof(AuthData::Record) <= end) { std::shared_ptr<authdb::AuthData::Record> cur = std::make_shared<authdb::AuthData::Record>(); _Backend.setPos(rd); _Backend.read((unsigned char*)cur.get(), sizeof(AuthData::Record)); rd = _Backend.getPos() + cur->datasize; size_t next = _Backend.getPos() + cur->datasize; if (next < _Backend.getPos() || next > end) break; rd = next; if (cur->type == GroupData && strcmp(cur->fieldname, "groupname") == 0) { class GroupData gdat(cur->ruid); Loading