1 diff -ru libtar-1.2.11/lib/extract.c libtar-1.2.11-new/lib/extract.c
2 --- libtar-1.2.11/lib/extract.c 2003-03-03 00:58:07.000000000 +0100
3 +++ libtar-1.2.11-new/lib/extract.c 2003-10-03 15:07:46.000000000 +0200
10 - char ln_save[MAXPATHLEN];
11 - char ln_real[MAXPATHLEN];
13 -typedef struct linkname linkname_t;
17 tar_set_file_perms(TAR *t, char *realname)
20 tar_extract_file(TAR *t, char *realname)
28 if (t->options & TAR_NOOVERWRITE)
34 - lnp = (linkname_t *)calloc(1, sizeof(linkname_t));
35 + pathname_len = strlen(th_get_pathname(t)) + 1;
36 + realname_len = strlen(realname) + 1;
37 + lnp = (char *)calloc(1, pathname_len + realname_len);
40 - strlcpy(lnp->ln_save, th_get_pathname(t), sizeof(lnp->ln_save));
41 - strlcpy(lnp->ln_real, realname, sizeof(lnp->ln_real));
42 + strcpy(&lnp[0], th_get_pathname(t));
43 + strcpy(&lnp[pathname_len], realname);
45 printf("tar_extract_file(): calling libtar_hash_add(): key=\"%s\", "
46 "value=\"%s\"\n", th_get_pathname(t), realname);
57 if (libtar_hash_getkey(t->h, &hp, th_get_linkname(t),
58 (libtar_matchfunc_t)libtar_str_match) != 0)
60 - lnp = (linkname_t *)libtar_hashptr_data(&hp);
61 - linktgt = lnp->ln_real;
62 + lnp = (char *)libtar_hashptr_data(&hp);
63 + linktgt = &lnp[strlen(lnp) + 1];
66 linktgt = th_get_linkname(t);