Control: tags -1 patch

On Fri, Nov 29, 2024 at 02:48:21PM +0100, John Paul Adrian Glaubitz wrote:
> Hello,
> 
> On Fri, 2024-11-29 at 14:28 +0100, Michael Prokop wrote:
> > I'm not sure how relevant hfsutils is those days, but due to this
> > FTBFS issue, hfsutils is no longer present in Debian unstable
> > nor testing, so it won't be shipped with Debian/trixie unless
> > someone takes care of this. :)
> 
> I am going to take care of this during the holidays. I'm just currently
> overloaded.

The Ubuntu diff has this fixed.

A minimal-ish change (without the debian/rules rewrite in the Ubuntu diff)
based on that is attached.

> Thanks,
> Adrian

cu
Adrian
diff -Nru hfsutils-3.2.6/debian/patches/0006-Fix-memory-corruption.patch 
hfsutils-3.2.6/debian/patches/0006-Fix-memory-corruption.patch
--- hfsutils-3.2.6/debian/patches/0006-Fix-memory-corruption.patch      
1970-01-01 02:00:00.000000000 +0200
+++ hfsutils-3.2.6/debian/patches/0006-Fix-memory-corruption.patch      
2024-04-14 14:46:37.000000000 +0300
@@ -0,0 +1,57 @@
+Description: Fix memory corruption in hfssh
+ This was caused by mismatched alloc/free functions.
+ Memory allocated by Tcl must be freed by TclFree and memory transferred to
+ Tcl must be allocated using TclAlloc.
+Author: Zixing Liu <zixing....@canonical.com>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=421457
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/hfsutils/+bug/493273
+Forwarded: no
+Last-Update: 2024-06-11
+---
+Index: hfsutils/tclhfs.c
+===================================================================
+--- hfsutils.orig/tclhfs.c
++++ hfsutils/tclhfs.c
+@@ -378,7 +378,7 @@ int file_cmd(ClientData clientData, Tcl_
+             return TCL_ERROR;
+           }
+ 
+-        mem = ALLOC(char, bytes + 1);
++        mem = Tcl_Alloc(bytes + 1);
+         if (mem == 0)
+           {
+             interp->result = "out of memory";
+@@ -1038,7 +1038,7 @@ int vol_cmd(ClientData clientData, Tcl_I
+           return TCL_ERROR;
+ 
+         fargv = hfs_glob(vol, listc, listv, &fargc);
+-        free(listv);
++        Tcl_Free(listv);
+ 
+         if (fargv == 0)
+           {
+@@ -1313,7 +1313,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
+         badblocks = ALLOCX(unsigned long, listc);
+         if (listc && badblocks == 0)
+           {
+-            free(listv);
++            Tcl_Free(listv);
+ 
+             interp->result = "out of memory";
+             return TCL_ERROR;
+@@ -1324,13 +1324,13 @@ int cmd_hfs(ClientData clientData, Tcl_I
+             if (Tcl_ExprLong(interp, listv[i],
+                              (long *) &badblocks[i]) != TCL_OK)
+               {
+-                free(listv);
++                Tcl_Free(listv);
+                 FREE(badblocks);
+                 return TCL_ERROR;
+               }
+           }
+ 
+-        free(listv);
++        Tcl_Free(listv);
+ 
+         if (do_format(argv[2], partno, 0, argv[4], listc, badblocks) == -1)
+           {
diff -Nru hfsutils-3.2.6/debian/patches/0007-Fix-cv-qualifiers.patch 
hfsutils-3.2.6/debian/patches/0007-Fix-cv-qualifiers.patch
--- hfsutils-3.2.6/debian/patches/0007-Fix-cv-qualifiers.patch  1970-01-01 
02:00:00.000000000 +0200
+++ hfsutils-3.2.6/debian/patches/0007-Fix-cv-qualifiers.patch  2024-04-14 
14:46:37.000000000 +0300
@@ -0,0 +1,660 @@
+Description: Fix cv-qualifiers for GCC 14.1
+ GCC 14 now enforces strict cv-qualifier check by default.
+ This patch fixes all the cv-qualifier violations.
+Author: Zixing Liu <zixing....@canonical.com>
+Forwarded: no
+Last-Update: 2024-07-31
+---
+Index: hfsutils/charset.c
+===================================================================
+--- hfsutils.orig/charset.c
++++ hfsutils/charset.c
+@@ -127,7 +127,7 @@ char *latin1_subst[128] = {
+  * NAME:      charset->unicode()
+  * DESCRIPTION:       return a Unicode string for MacOS Standard Roman
+  */
+-UCS2 *cs_unicode(char *mstr, int *lenptr)
++UCS2 *cs_unicode(const char *mstr, int *lenptr)
+ {
+   int len, i;
+   UCS2 *unicode, *ptr;
+@@ -151,7 +151,7 @@ UCS2 *cs_unicode(char *mstr, int *lenptr
+  * NAME:      charset->latin1()
+  * DESCRIPTION:       return a Latin-1 (ISO 8859-1) string for MacOS Standard 
Roman
+  */
+-char *cs_latin1(char *mstr, int *lenptr)
++char *cs_latin1(const char *mstr, int *lenptr)
+ {
+   int ilen, olen, i;
+   char *latin1, *ptr;
+@@ -229,7 +229,7 @@ void mktable(void)
+  * NAME:      charset->macroman()
+  * DESCRIPTION:       return a MacOS Standard Roman string for Latin-1 (ISO 
8859-1)
+  */
+-char *cs_macroman(char *lstr, int *lenptr)
++char *cs_macroman(const char *lstr, int *lenptr)
+ {
+   int ilen, olen, i;
+   char *macroman, *ptr;
+Index: hfsutils/charset.h
+===================================================================
+--- hfsutils.orig/charset.h
++++ hfsutils/charset.h
+@@ -21,7 +21,7 @@
+ 
+ typedef unsigned short UCS2;
+ 
+-UCS2 *cs_unicode(char *, int *);
++UCS2 *cs_unicode(const char *, int *);
+ 
+-char *cs_latin1(char *, int *);
+-char *cs_macroman(char *, int *);
++char *cs_latin1(const char *, int *);
++char *cs_macroman(const char *, int *);
+Index: hfsutils/glob.c
+===================================================================
+--- hfsutils.orig/glob.c
++++ hfsutils/glob.c
+@@ -336,7 +336,7 @@ int doglob(hfsvol *vol, dlist *list, con
+  * NAME:      hfs->glob()
+  * DESCRIPTION:       perform glob pattern matching
+  */
+-char **hfs_glob(hfsvol *vol, int argc, char *argv[], int *nelts)
++char **hfs_glob(hfsvol *vol, int argc, const char *argv[], int *nelts)
+ {
+   dlist list;
+   int i;
+Index: hfsutils/glob.h
+===================================================================
+--- hfsutils.orig/glob.h
++++ hfsutils/glob.h
+@@ -19,4 +19,4 @@
+  * $Id: glob.h,v 1.6 1998/04/11 08:26:55 rob Exp $
+  */
+ 
+-char **hfs_glob(hfsvol *, int, char *[], int *);
++char **hfs_glob(hfsvol *, int, const char *[], int *);
+Index: hfsutils/hattrib.c
+===================================================================
+--- hfsutils.orig/hattrib.c
++++ hfsutils/hattrib.c
+@@ -51,7 +51,7 @@ int usage(void)
+  * NAME:      hattrib->main()
+  * DESCRIPTION:       implement hattrib command
+  */
+-int hattrib_main(int argc, char *argv[])
++int hattrib_main(int argc, const char *argv[])
+ {
+   const char *type = 0, *crea = 0;
+   int invis = 0, lock = 0, bless = 0;
+Index: hfsutils/hattrib.h
+===================================================================
+--- hfsutils.orig/hattrib.h
++++ hfsutils/hattrib.h
+@@ -19,4 +19,4 @@
+  * $Id: hattrib.h,v 1.6 1998/04/11 08:26:56 rob Exp $
+  */
+ 
+-int hattrib_main(int, char *[]);
++int hattrib_main(int, const char *[]);
+Index: hfsutils/hcd.c
+===================================================================
+--- hfsutils.orig/hcd.c
++++ hfsutils/hcd.c
+@@ -36,7 +36,7 @@
+  * NAME:      hcd->main()
+  * DESCRIPTION:       implement hcd command
+  */
+-int hcd_main(int argc, char *argv[])
++int hcd_main(int argc, const char *argv[])
+ {
+   mountent *ment;
+   hfsvol *vol;
+Index: hfsutils/hcd.h
+===================================================================
+--- hfsutils.orig/hcd.h
++++ hfsutils/hcd.h
+@@ -19,4 +19,4 @@
+  * $Id: hcd.h,v 1.7 1998/04/11 08:26:56 rob Exp $
+  */
+ 
+-int hcd_main(int, char *[]);
++int hcd_main(int, const char *[]);
+Index: hfsutils/hcopy.c
+===================================================================
+--- hfsutils.orig/hcopy.c
++++ hfsutils/hcopy.c
+@@ -252,7 +252,7 @@ int usage(void)
+  * NAME:      hcopy->main()
+  * DESCRIPTION:       implement hcopy command
+  */
+-int hcopy_main(int argc, char *argv[])
++int hcopy_main(int argc, const char *argv[])
+ {
+   int nargs, mode = 'a', result = 0;
+   const char *target;
+@@ -265,7 +265,7 @@ int hcopy_main(int argc, char *argv[])
+     {
+       int opt;
+ 
+-      opt = getopt(argc, argv, "mbtra");
++      opt = getopt(argc, (char**)argv, "mbtra");
+       if (opt == EOF)
+       break;
+ 
+@@ -294,7 +294,7 @@ int hcopy_main(int argc, char *argv[])
+ 
+       copy  = do_copyin;
+       fargc = nargs - 1;
+-      fargv = &argv[optind];
++      fargv = (char**)&argv[optind];
+     }
+   else
+     {
+@@ -311,7 +311,7 @@ int hcopy_main(int argc, char *argv[])
+ 
+   hfsutil_unmount(vol, &result);
+ 
+-  if (fargv && fargv != &argv[optind])
++  if (fargv && fargv != (char**)&argv[optind])
+     free(fargv);
+ 
+   return result;
+Index: hfsutils/hcopy.h
+===================================================================
+--- hfsutils.orig/hcopy.h
++++ hfsutils/hcopy.h
+@@ -19,4 +19,4 @@
+  * $Id: hcopy.h,v 1.6 1998/04/11 08:26:56 rob Exp $
+  */
+ 
+-int hcopy_main(int, char *[]);
++int hcopy_main(int, const char *[]);
+Index: hfsutils/hdel.c
+===================================================================
+--- hfsutils.orig/hdel.c
++++ hfsutils/hdel.c
+@@ -35,7 +35,7 @@
+  * NAME:      hdel->main()
+  * DESCRIPTION:       implement hdel command
+  */
+-int hdel_main(int argc, char *argv[])
++int hdel_main(int argc, const char *argv[])
+ {
+   hfsvol *vol;
+   int fargc;
+Index: hfsutils/hdel.h
+===================================================================
+--- hfsutils.orig/hdel.h
++++ hfsutils/hdel.h
+@@ -19,4 +19,4 @@
+  * $Id: hdel.h,v 1.6 1998/04/11 08:26:57 rob Exp $
+  */
+ 
+-int hdel_main(int, char *[]);
++int hdel_main(int, const char *[]);
+Index: hfsutils/hformat.c
+===================================================================
+--- hfsutils.orig/hformat.c
++++ hfsutils/hformat.c
+@@ -75,7 +75,7 @@ hfsvol *do_format(const char *path, int
+  * NAME:      hformat->main()
+  * DESCRIPTION:       implement hformat command
+  */
+-int hformat_main(int argc, char *argv[])
++int hformat_main(int argc, const char *argv[])
+ {
+   const char *vname;
+   char *path = 0;
+@@ -89,7 +89,7 @@ int hformat_main(int argc, char *argv[])
+     {
+       int opt;
+ 
+-      opt = getopt(argc, argv, "fl:");
++      opt = getopt(argc, (char**)argv, "fl:");
+       if (opt == EOF)
+       break;
+ 
+Index: hfsutils/hformat.h
+===================================================================
+--- hfsutils.orig/hformat.h
++++ hfsutils/hformat.h
+@@ -19,4 +19,4 @@
+  * $Id: hformat.h,v 1.7 1998/04/11 08:26:57 rob Exp $
+  */
+ 
+-int hformat_main(int, char *[]);
++int hformat_main(int, const char *[]);
+Index: hfsutils/hfsutil.c
+===================================================================
+--- hfsutils.orig/hfsutil.c
++++ hfsutils/hfsutil.c
+@@ -64,14 +64,14 @@ const char *argv0, *bargv0;
+  * NAME:      main()
+  * DESCRIPTION:       program entry dispatch
+  */
+-int main(int argc, char *argv[])
++int main(int argc, const char *argv[])
+ {
+   int i, len;
+   const char *dot;
+ 
+   struct {
+     const char *name;
+-    int (*func)(int, char *[]);
++    int (*func)(int, const char *[]);
+   } list[] = {
+     { "hattrib", hattrib_main },
+     { "hcd",     hcd_main     },
+@@ -254,7 +254,7 @@ void hfsutil_pinfo(hfsvolent *ent)
+  * NAME:      hfsutil->glob()
+  * DESCRIPTION:       perform filename globbing
+  */
+-char **hfsutil_glob(hfsvol *vol, int argc, char *argv[],
++char **hfsutil_glob(hfsvol *vol, int argc, const char *argv[],
+                   int *nelts, int *result)
+ {
+   char **fargv;
+@@ -276,7 +276,7 @@ char **hfsutil_glob(hfsvol *vol, int arg
+ char *hfsutil_getcwd(hfsvol *vol)
+ {
+   char *path, name[HFS_MAX_FLEN + 1 + 1];
+-  long cwd;
++  unsigned long cwd;
+   int pathlen;
+ 
+   path    = malloc(1);
+Index: hfsutils/hfsutil.h
+===================================================================
+--- hfsutils.orig/hfsutil.h
++++ hfsutils/hfsutil.h
+@@ -32,7 +32,7 @@ hfsvol *hfsutil_remount(mountent *, int)
+ void hfsutil_unmount(hfsvol *, int *);
+ 
+ void hfsutil_pinfo(hfsvolent *);
+-char **hfsutil_glob(hfsvol *, int, char *[], int *, int *);
++char **hfsutil_glob(hfsvol *, int, const char *[], int *, int *);
+ char *hfsutil_getcwd(hfsvol *);
+ 
+ int hfsutil_samepath(const char *, const char *);
+Index: hfsutils/hls.c
+===================================================================
+--- hfsutils.orig/hls.c
++++ hfsutils/hls.c
+@@ -828,7 +828,7 @@ int queuepath(hfsvol *vol, char *path, d
+  * NAME:      hls->main()
+  * DESCRIPTION:       implement hls command
+  */
+-int hls_main(int argc, char *argv[])
++int hls_main(int argc, const char *argv[])
+ {
+   hfsvol *vol;
+   int fargc, i;
+@@ -871,7 +871,7 @@ int hls_main(int argc, char *argv[])
+     {
+       int opt;
+ 
+-      opt = getopt(argc, argv, "1abcdfilmqrstxw:CFNQRSU");
++      opt = getopt(argc, (char**)argv, "1abcdfilmqrstxw:CFNQRSU");
+       if (opt == EOF)
+       break;
+ 
+Index: hfsutils/hls.h
+===================================================================
+--- hfsutils.orig/hls.h
++++ hfsutils/hls.h
+@@ -19,4 +19,4 @@
+  * $Id: hls.h,v 1.6 1998/04/11 08:26:58 rob Exp $
+  */
+ 
+-int hls_main(int, char *[]);
++int hls_main(int, const char *[]);
+Index: hfsutils/hmkdir.c
+===================================================================
+--- hfsutils.orig/hmkdir.c
++++ hfsutils/hmkdir.c
+@@ -35,7 +35,7 @@
+  * NAME:      hmkdir->main()
+  * DESCRIPTION:       implement hmkdir command
+  */
+-int hmkdir_main(int argc, char *argv[])
++int hmkdir_main(int argc, const char *argv[])
+ {
+   hfsvol *vol;
+   char **fargv;
+Index: hfsutils/hmkdir.h
+===================================================================
+--- hfsutils.orig/hmkdir.h
++++ hfsutils/hmkdir.h
+@@ -19,4 +19,4 @@
+  * $Id: hmkdir.h,v 1.6 1998/04/11 08:26:58 rob Exp $
+  */
+ 
+-int hmkdir_main(int, char *[]);
++int hmkdir_main(int, const char *[]);
+Index: hfsutils/hmount.c
+===================================================================
+--- hfsutils.orig/hmount.c
++++ hfsutils/hmount.c
+@@ -36,7 +36,7 @@
+  * NAME:      hmount->main()
+  * DESCRIPTION:       implement hmount command
+  */
+-int hmount_main(int argc, char *argv[])
++int hmount_main(int argc, const char *argv[])
+ {
+   char *path = 0;
+   hfsvol *vol;
+Index: hfsutils/hmount.h
+===================================================================
+--- hfsutils.orig/hmount.h
++++ hfsutils/hmount.h
+@@ -19,4 +19,4 @@
+  * $Id: hmount.h,v 1.7 1998/04/11 08:26:59 rob Exp $
+  */
+ 
+-int hmount_main(int, char *[]);
++int hmount_main(int, const char *[]);
+Index: hfsutils/hpwd.c
+===================================================================
+--- hfsutils.orig/hpwd.c
++++ hfsutils/hpwd.c
+@@ -35,7 +35,7 @@
+  * NAME:      hpwd->main()
+  * DESCRIPTION:       implement hpwd command
+  */
+-int hpwd_main(int argc, char *argv[])
++int hpwd_main(int argc, const char *argv[])
+ {
+   mountent *ent;
+ 
+Index: hfsutils/hpwd.h
+===================================================================
+--- hfsutils.orig/hpwd.h
++++ hfsutils/hpwd.h
+@@ -19,4 +19,4 @@
+  * $Id: hpwd.h,v 1.7 1998/04/11 08:26:59 rob Exp $
+  */
+ 
+-int hpwd_main(int, char *[]);
++int hpwd_main(int, const char *[]);
+Index: hfsutils/hrename.c
+===================================================================
+--- hfsutils.orig/hrename.c
++++ hfsutils/hrename.c
+@@ -67,7 +67,7 @@ int do_rename(hfsvol *vol, int argc, cha
+  * NAME:      hrename->main()
+  * DESCRIPTION:       implement hrename command
+  */
+-int hrename_main(int argc, char *argv[])
++int hrename_main(int argc, const char *argv[])
+ {
+   mountent *ment;
+   hfsvol *vol;
+Index: hfsutils/hrename.h
+===================================================================
+--- hfsutils.orig/hrename.h
++++ hfsutils/hrename.h
+@@ -19,4 +19,4 @@
+  * $Id: hrename.h,v 1.6 1998/04/11 08:26:59 rob Exp $
+  */
+ 
+-int hrename_main(int, char *[]);
++int hrename_main(int, const char *[]);
+Index: hfsutils/hrmdir.c
+===================================================================
+--- hfsutils.orig/hrmdir.c
++++ hfsutils/hrmdir.c
+@@ -35,7 +35,7 @@
+  * NAME:      hrmdir->main()
+  * DESCRIPTION:       implement hrmdir command
+  */
+-int hrmdir_main(int argc, char *argv[])
++int hrmdir_main(int argc, const char *argv[])
+ {
+   hfsvol *vol;
+   char **fargv;
+Index: hfsutils/hrmdir.h
+===================================================================
+--- hfsutils.orig/hrmdir.h
++++ hfsutils/hrmdir.h
+@@ -19,4 +19,4 @@
+  * $Id: hrmdir.h,v 1.6 1998/04/11 08:26:59 rob Exp $
+  */
+ 
+-int hrmdir_main(int, char *[]);
++int hrmdir_main(int, const char *[]);
+Index: hfsutils/humount.c
+===================================================================
+--- hfsutils.orig/humount.c
++++ hfsutils/humount.c
+@@ -35,7 +35,7 @@
+  * NAME:      humount->main()
+  * DESCRIPTION:       implement humount command
+  */
+-int humount_main(int argc, char *argv[])
++int humount_main(int argc, const char *argv[])
+ {
+   int vnum;
+   mountent *ent;
+Index: hfsutils/humount.h
+===================================================================
+--- hfsutils.orig/humount.h
++++ hfsutils/humount.h
+@@ -19,4 +19,4 @@
+  * $Id: humount.h,v 1.6 1998/04/11 08:26:59 rob Exp $
+  */
+ 
+-int humount_main(int, char *[]);
++int humount_main(int, const char *[]);
+Index: hfsutils/hvol.c
+===================================================================
+--- hfsutils.orig/hvol.c
++++ hfsutils/hvol.c
+@@ -64,7 +64,7 @@ int showvol(mountent *ment)
+  * NAME:      hvol->main()
+  * DESCRIPTION:       implement hvol command
+  */
+-int hvol_main(int argc, char *argv[])
++int hvol_main(int argc, const char *argv[])
+ {
+   int vnum;
+   mountent *ment;
+Index: hfsutils/hvol.h
+===================================================================
+--- hfsutils.orig/hvol.h
++++ hfsutils/hvol.h
+@@ -19,4 +19,4 @@
+  * $Id: hvol.h,v 1.7 1998/04/11 08:27:00 rob Exp $
+  */
+ 
+-int hvol_main(int, char *[]);
++int hvol_main(int, const char *[]);
+Index: hfsutils/tclhfs.c
+===================================================================
+--- hfsutils.orig/tclhfs.c
++++ hfsutils/tclhfs.c
+@@ -119,7 +119,7 @@ char *direntstr(hfsdirent *ent)
+     mddate[CHARLEN(long) + 1],
+     bkdate[CHARLEN(long) + 1];
+   register int argc;
+-  char *argv[24];
++  const char *argv[24];
+   int locked, invis;
+ 
+   argc = 0;
+@@ -275,7 +275,7 @@ void file_del(ClientData clientData)
+  */
+ static
+ int file_cmd(ClientData clientData, Tcl_Interp *interp,
+-           int argc, char *argv[])
++           int argc, const char *argv[])
+ {
+   fileref *fref = clientData;
+   hfsfile *file = fref->file;
+@@ -546,7 +546,7 @@ int do_copynative(Tcl_Interp *interp, hf
+  * DESCRIPTION:       copy an HFS file to another HFS volume
+  */
+ static
+-int copynative(Tcl_Interp *interp, volref *srcvref, char *argv[])
++int copynative(Tcl_Interp *interp, volref *srcvref, const char *argv[])
+ {
+   volref *dstvref;
+   Tcl_CmdInfo info;
+@@ -654,7 +654,7 @@ int copynative(Tcl_Interp *interp, volre
+  * DESCRIPTION:       copy a UNIX file into an HFS volume
+  */
+ static
+-int copyin(Tcl_Interp *interp, hfsvol *vol, char *argv[])
++int copyin(Tcl_Interp *interp, hfsvol *vol, const char *argv[])
+ {
+   cpifunc copyfile;
+ 
+@@ -689,7 +689,7 @@ int copyin(Tcl_Interp *interp, hfsvol *v
+  * DESCRIPTION:       copy an HFS file out to a UNIX file
+  */
+ static
+-int copyout(Tcl_Interp *interp, hfsvol *vol, char *argv[])
++int copyout(Tcl_Interp *interp, hfsvol *vol, const char *argv[])
+ {
+   cpofunc copyfile;
+ 
+@@ -812,7 +812,7 @@ void vol_del(ClientData clientData)
+  */
+ static
+ int vol_cmd(ClientData clientData, Tcl_Interp *interp,
+-          int argc, char *argv[])
++          int argc, const char *argv[])
+ {
+   volref *vref = clientData;
+   hfsvol *vol  = vref->vol;
+@@ -873,9 +873,9 @@ int vol_cmd(ClientData clientData, Tcl_I
+       else if (strcmp(argv[1], "path") == 0)
+       {
+         char name[HFS_MAX_FLEN + 1];
+-        long id;
++        unsigned long id;
+         int listc, i;
+-        char **listv;
++        const char **listv;
+         char *result;
+ 
+         id = vref->cwd;
+@@ -894,7 +894,7 @@ int vol_cmd(ClientData clientData, Tcl_I
+ 
+         for (i = 0; i < listc / 2; ++i)
+           {
+-            char *tmp;
++            const char *tmp;
+ 
+             tmp = listv[i];
+             listv[i] = listv[listc - 1 - i];
+@@ -938,7 +938,7 @@ int vol_cmd(ClientData clientData, Tcl_I
+       }
+       else if (strcmp(argv[1], "dirinfo") == 0)
+       {
+-        long id;
++        unsigned long id;
+         char name[HFS_MAX_FLEN + 1], idstr[CHARLEN(unsigned long) + 1];
+ 
+         if (Tcl_ExprLong(interp, argv[2], &id) != TCL_OK)
+@@ -1029,7 +1029,8 @@ int vol_cmd(ClientData clientData, Tcl_I
+       else if (strcmp(argv[1], "glob") == 0)
+       {
+         int listc, fargc;
+-        char **listv, **fargv, *result;
++        const char **listv;
++        char  **fargv, *result;
+ 
+         if (hfs_setcwd(vol, vref->cwd) == -1)
+           return error(interp, 0);
+@@ -1038,7 +1039,7 @@ int vol_cmd(ClientData clientData, Tcl_I
+           return TCL_ERROR;
+ 
+         fargv = hfs_glob(vol, listc, listv, &fargc);
+-        Tcl_Free(listv);
++        Tcl_Free((void*)listv);
+ 
+         if (fargv == 0)
+           {
+@@ -1046,7 +1047,7 @@ int vol_cmd(ClientData clientData, Tcl_I
+             return TCL_ERROR;
+           }
+ 
+-        result = Tcl_Merge(fargc, fargv);
++        result = Tcl_Merge(fargc, (const char**)fargv);
+         free(fargv);
+ 
+         Tcl_SetResult(interp, result, TCL_DYNAMIC);
+@@ -1157,7 +1158,7 @@ int vol_cmd(ClientData clientData, Tcl_I
+  */
+ static
+ int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
+-          int argc, char *argv[])
++          int argc, const char *argv[])
+ {
+   static int id = 0;
+ 
+@@ -1304,7 +1305,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
+       if (argc == 6)
+       {
+         int listc, i;
+-        char **listv;
++        const char **listv;
+         unsigned long *badblocks;
+ 
+         if (Tcl_SplitList(interp, argv[5], &listc, &listv) != TCL_OK)
+@@ -1313,7 +1314,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
+         badblocks = ALLOCX(unsigned long, listc);
+         if (listc && badblocks == 0)
+           {
+-            Tcl_Free(listv);
++            Tcl_Free((void*)listv);
+ 
+             interp->result = "out of memory";
+             return TCL_ERROR;
+@@ -1324,13 +1325,13 @@ int cmd_hfs(ClientData clientData, Tcl_I
+             if (Tcl_ExprLong(interp, listv[i],
+                              (long *) &badblocks[i]) != TCL_OK)
+               {
+-                Tcl_Free(listv);
++                Tcl_Free((void*)listv);
+                 FREE(badblocks);
+                 return TCL_ERROR;
+               }
+           }
+ 
+-        Tcl_Free(listv);
++        Tcl_Free((void*)listv);
+ 
+         if (do_format(argv[2], partno, 0, argv[4], listc, badblocks) == -1)
+           {
+@@ -1377,7 +1378,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
+       result = cs_latin1(argv[4], 0);
+       else
+       {
+-        Tcl_SetResult(interp, argv[4], TCL_VOLATILE);
++        Tcl_SetObjResult(interp, Tcl_NewStringObj(argv[4], -1));
+         return TCL_OK;
+       }
+ 
+@@ -1448,7 +1449,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
+  */
+ static
+ int cmd_exit(ClientData clientData, Tcl_Interp *interp,
+-           int argc, char *argv[])
++           int argc, const char *argv[])
+ {
+   int status = 0;
+ 
+@@ -1477,8 +1478,8 @@ int Hfs_Init(Tcl_Interp *interp)
+   Tcl_InitHashTable(&volumes, TCL_ONE_WORD_KEYS);
+   Tcl_InitHashTable(&files,   TCL_ONE_WORD_KEYS);
+ 
+-  Tcl_CreateCommand(interp, "hfs",   cmd_hfs,   0, 0);
+-  Tcl_CreateCommand(interp, "exit",  cmd_exit,  0, 0);
++  Tcl_CreateCommand(interp, "hfs",   cmd_hfs,   NULL, NULL);
++  Tcl_CreateCommand(interp, "exit",  cmd_exit,  NULL, NULL);
+ 
+   return TCL_OK;
+ }
diff -Nru hfsutils-3.2.6/debian/patches/series 
hfsutils-3.2.6/debian/patches/series
--- hfsutils-3.2.6/debian/patches/series        2024-04-14 14:45:36.000000000 
+0300
+++ hfsutils-3.2.6/debian/patches/series        2024-04-14 14:46:37.000000000 
+0300
@@ -3,3 +3,5 @@
 0003-Add-support-for-files-larger-than-2GB.patch
 0004-Add-DUSE_INTERP_RESULT-to-DEFINES-in-Makefile.in.patch
 0005-Fix-missing-inclusion-of-string.h-in-hpwd.c.patch
+0006-Fix-memory-corruption.patch
+0007-Fix-cv-qualifiers.patch
diff -Nru hfsutils-3.2.6/debian/rules hfsutils-3.2.6/debian/rules
--- hfsutils-3.2.6/debian/rules 2021-01-23 16:13:30.000000000 +0200
+++ hfsutils-3.2.6/debian/rules 2024-04-14 14:46:37.000000000 +0300
@@ -15,6 +15,7 @@
 build: build-stamp
 build-stamp:
        dh_testdir
+       dh_autoreconf
 
        # Add here commands to compile the package.
        CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix=/usr \
@@ -33,6 +34,7 @@
        # Add here commands to clean up after the build process.
        [ ! -f Makefile ] || $(MAKE) distclean
 
+       dh_autoreconf_clean
        dh_clean
 
 install: build

Reply via email to