Skip to content

Commit 4db8231

Browse files
committed
[Issue #260] fix integer overflow
1 parent ee6d032 commit 4db8231

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/backup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ get_database_map(PGconn *conn)
12691269
db_map_entry *db_entry = (db_map_entry *) pgut_malloc(sizeof(db_map_entry));
12701270

12711271
/* get Oid */
1272-
db_entry->dbOid = atoi(PQgetvalue(res, i, 0));
1272+
db_entry->dbOid = atoll(PQgetvalue(res, i, 0));
12731273

12741274
/* get datname */
12751275
datname = PQgetvalue(res, i, 1);
@@ -2644,7 +2644,7 @@ IdentifySystem(StreamThreadArg *stream_thread_arg)
26442644
}
26452645

26462646
stream_conn_sysidentifier_str = PQgetvalue(res, 0, 0);
2647-
stream_conn_tli = atoi(PQgetvalue(res, 0, 1));
2647+
stream_conn_tli = atoll(PQgetvalue(res, 0, 1));
26482648

26492649
/* Additional sanity, primary for PG 9.5,
26502650
* where system id can be obtained only via "IDENTIFY SYSTEM"

src/checkdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ get_index_list(const char *dbname, bool first_db_with_amcheck,
439439
char *namespace = NULL;
440440

441441
/* index oid */
442-
ind->indexrelid = atoi(PQgetvalue(res, i, 0));
442+
ind->indexrelid = atoll(PQgetvalue(res, i, 0));
443443

444444
/* index relname */
445445
name = PQgetvalue(res, i, 1);

src/ptrack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ pg_ptrack_clear(PGconn *backup_conn, int ptrack_version_num)
284284
if (strcmp(dbname, "template0") == 0)
285285
continue;
286286

287-
dbOid = atoi(PQgetvalue(res_db, i, 1));
288-
tblspcOid = atoi(PQgetvalue(res_db, i, 2));
287+
dbOid = atoll(PQgetvalue(res_db, i, 1));
288+
tblspcOid = atoll(PQgetvalue(res_db, i, 2));
289289

290290
tmp_conn = pgut_connect(instance_config.conn_opt.pghost, instance_config.conn_opt.pgport,
291291
dbname,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy