Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 9848bc2

Browse files
aborodinzyv
authored andcommitted
tar: initialize variables passed to stoint().
Signed-off-by: Andrew Borodin <[email protected]> Signed-off-by: Yury V. Zaytsev <[email protected]>
1 parent a5b290f commit 9848bc2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/vfs/tar/tar-sparse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ static struct tar_sparse_optab const pax_optab = {
253253
static gboolean
254254
decode_num (uintmax_t *num, const char *arg, uintmax_t maxval)
255255
{
256-
char *arg_lim;
257-
gboolean overflow;
256+
char *arg_lim = NULL;
257+
gboolean overflow = FALSE;
258258

259259
*num = stoint (arg, &arg_lim, &overflow, 0, maxval);
260260
return !(arg_lim == arg || *arg_lim != '\0' || overflow);

src/vfs/tar/tar-xheader.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static struct timespec
255255
decode_timespec (const char *arg, char **arg_lim, gboolean parse_fraction)
256256
{
257257
int ns = -1;
258-
gboolean overflow;
258+
gboolean overflow = FALSE;
259259
time_t s;
260260
char const *p;
261261
struct timespec r;
@@ -341,8 +341,8 @@ static gboolean
341341
decode_signed_num (intmax_t *num, const char *arg, intmax_t minval, uintmax_t maxval,
342342
const char *keyword)
343343
{
344-
char *arg_lim;
345-
gboolean overflow;
344+
char *arg_lim = NULL;
345+
gboolean overflow = FALSE;
346346
intmax_t u;
347347

348348
(void) keyword;
@@ -583,7 +583,7 @@ decode_record (struct xheader *xhdr, char **ptr,
583583
char *start = *ptr;
584584
char *p = start;
585585
idx_t len;
586-
char *len_lim;
586+
char *len_lim = NULL;
587587
const char *keyword;
588588
char *nextp;
589589
idx_t len_max;
@@ -802,8 +802,8 @@ sparse_map_decoder (struct tar_stat_info *st, const char *keyword, const char *a
802802
while (TRUE)
803803
{
804804
off_t u;
805-
char *delim;
806-
gboolean overflow;
805+
char *delim = NULL;
806+
gboolean overflow = FALSE;
807807

808808
u = stoint (arg, &delim, &overflow, 0, TYPE_MAXIMUM (off_t));
809809

0 commit comments

Comments
 (0)