[SCM] csound/master: Fix FTBFS with -Werror=format-security. Closes: #649462

fsateler at users.alioth.debian.org fsateler at users.alioth.debian.org
Thu Nov 24 01:33:50 UTC 2011


The following commit has been merged in the master branch:
commit 1a00be34ee45a341661a2a563aca62afdfe244c5
Author: Felipe Sateler <fsateler at debian.org>
Date:   Wed Nov 23 22:03:51 2011 -0300

    Fix FTBFS with -Werror=format-security. Closes: #649462
    
    Picked patch from upstream

diff --git a/debian/patches/0000-fix-ftbfs-format-security.diff b/debian/patches/0000-fix-ftbfs-format-security.diff
new file mode 100644
index 0000000..6d17c79
--- /dev/null
+++ b/debian/patches/0000-fix-ftbfs-format-security.diff
@@ -0,0 +1,728 @@
+From d5ef5acbffae971297ff870ef34b3b2b5f3e8121 Mon Sep 17 00:00:00 2001
+From: Felipe Sateler <fsateler at debian.org>
+Date: Wed, 23 Nov 2011 21:41:39 -0300
+Subject: [PATCH] Fix build errors with -Werror=format-security
+
+Gcc with that option enabled fails when format strings are not string
+constants and there are no arguments (because it is possibly an error:
+accepting user input and then printf'ing it). Fix is to add a %s format
+string.
+---
+ InOut/virtual_keyboard/virtual_keyboard.cpp |    2 +-
+ InOut/widgets.cpp                           |  244 ++++++++++++++++-----------
+ InOut/winFLTK.c                             |    2 +-
+ frontends/CsoundAC/Counterpoint.cpp         |    4 +-
+ frontends/CsoundAC/System.cpp               |    2 +-
+ 5 files changed, 153 insertions(+), 101 deletions(-)
+
+diff --git a/InOut/virtual_keyboard/virtual_keyboard.cpp b/InOut/virtual_keyboard/virtual_keyboard.cpp
+index 93d3501..801ff7b 100644
+--- a/InOut/virtual_keyboard/virtual_keyboard.cpp
++++ b/InOut/virtual_keyboard/virtual_keyboard.cpp
+@@ -431,7 +431,7 @@ PUBLIC int csoundModuleInit(CSOUND *csound)
+                                     "FLTK_Flags") == (void*) 0) {
+       if (csound->CreateGlobalVariable(csound,
+                                        "FLTK_Flags", sizeof(int)) != 0)
+-        csound->Die(csound,
++        csound->Die(csound, "%s",
+                     Str("virtual_keyboard.cpp: error allocating FLTK flags"));
+     }
+ 
+diff --git a/InOut/widgets.cpp b/InOut/widgets.cpp
+index f15da1f..2c698c8 100644
+--- a/InOut/widgets.cpp
++++ b/InOut/widgets.cpp
+@@ -1078,7 +1078,8 @@ SNAPSHOT::SNAPSHOT (vector<ADDR_SET_VALUE>& valuators, int snapGroup)
+       opcode_name = fld->opcode_name = ((OPDS *) (v.opcode))->optext->t.opcod;
+       if (UNLIKELY(opcode_name.c_str() == NULL))
+         {
+-          csound->InitError(csound,Str("Invalid snapshot. Perhaps you modified "
++          csound->InitError(csound, "%s",
++                                   Str("Invalid snapshot. Perhaps you modified "
+                                        "orchestra widget code after you saved "
+                                        "the snapshot bank."));
+           goto err;
+@@ -1463,7 +1464,8 @@ extern "C" {
+             table[index*numfields+j] = snap.fields[j].value;
+           }
+         }
+-        else return csound->InitError(csound, Str("FLsetsnap: invalid table"));
++        else return csound->InitError(csound, "%s",
++                                             Str("FLsetsnap: invalid table"));
+       }
+       else { // else store it into snapshot bank
+         if ((int) ST(snapshots)[group].size() < index+1)
+@@ -1513,8 +1515,8 @@ extern "C" {
+         {
+           int   n;
+           Fl_lock(csound);
+-          n = fl_choice(Str("Saving could overwrite the old file.\n"
+-                            "Are you sure you want to save ?"),
++          n = fl_choice("%s", Str("Saving could overwrite the old file.\n"
++                                  "Are you sure you want to save ?"),
+                         Str("No"), Str("Yes"), NULL);
+           Fl_unlock(csound);
+           if (!n)
+@@ -1524,7 +1526,8 @@ extern "C" {
+       csound->strarg2name(csound, s, p->filename, "snap.", p->XSTRCODE);
+       s2 = csound->FindOutputFile(csound, s, "SNAPDIR");
+       if (UNLIKELY(s2 == NULL))
+-        return csound->InitError(csound, Str("FLsavesnap: cannot open file"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLsavesnap: cannot open file"));
+       strcpy(s, s2);
+       csound->Free(csound, s2);
+       filename = s;
+@@ -1577,7 +1580,8 @@ extern "C" {
+       csound->strarg2name(csound, s, p->filename, "snap.", p->XSTRCODE);
+       s2 = csound->FindInputFile(csound, s, "SNAPDIR");
+       if (UNLIKELY(s2 == NULL))
+-        return csound->InitError(csound, Str("FLloadsnap: cannot open file"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLloadsnap: cannot open file"));
+       strcpy(s, s2);
+       csound->Free(csound, s2);
+       filename = s;
+@@ -1622,6 +1626,7 @@ extern "C" {
+           if (UNLIKELY(!(opc_orig == opc))) {
+             //return csound->InitError(csound,
+             csound->Message(csound,
++                            "%s",
+                             Str("unmatched widget, probably due to a "
+                                 "modified orchestra. Modifying an "
+                                 "orchestra makes it incompatible with "
+@@ -2122,7 +2127,8 @@ static void fl_callbackExecButton(Fl_Button* w, void *a)
+ 
+       _exit(0);
+     } else if (UNLIKELY(pId < 0)) {
+-      p->csound->Message(p->csound, Str("Error: Unable to fork process\n"));
++      p->csound->Message(p->csound, "%s",
++                         Str("Error: Unable to fork process\n"));
+     }
+ 
+     csound->Free(csound, command);
+@@ -2542,12 +2548,14 @@ extern "C" {
+       ST(stack_count)--;
+       ADDR_STACK adrstk = ST(AddrStack).back();
+       if (UNLIKELY(strcmp( adrstk.h->optext->t.opcod, "FLpanel")))
+-        return csound->InitError(csound, Str("FLpanel_end: invalid stack pointer: "
+-                                             "verify its placement"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLpanel_end: invalid stack pointer: "
++                                     "verify its placement"));
+       if (UNLIKELY(adrstk.count != ST(stack_count)))
+-        return csound->InitError(csound, Str("FLpanel_end: invalid stack count: "
+-                                             "verify FLpanel/FLpanel_end count and"
+-                                             " placement"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLpanel_end: invalid stack count: "
++                                     "verify FLpanel/FLpanel_end count and"
++                                     " placement"));
+       ((Fl_Window*) adrstk.WidgAddress)->end();
+       ST(AddrStack).pop_back();
+       return OK;
+@@ -2570,12 +2578,14 @@ extern "C" {
+       ADDR_STACK adrstk = ST(AddrStack).back();
+       if (UNLIKELY(strcmp( adrstk.h->optext->t.opcod, "FLscroll")))
+         return
+-          csound->InitError(csound, Str("FLscroll_end: invalid stack pointer: "
+-                                        "verify its placement"));
++          csound->InitError(csound, "%s",
++                            Str("FLscroll_end: invalid stack pointer: "
++                                "verify its placement"));
+       if (UNLIKELY(adrstk.count != ST(stack_count)))
+-        return csound->InitError(csound, Str("FLscroll_end: invalid stack count: "
+-                                             "verify FLscroll/FLscroll_end count "
+-                                             "and placement"));
++        return csound->InitError(csound, "%s",
++                            Str("FLscroll_end: invalid stack count: "
++                                "verify FLscroll/FLscroll_end count "
++                                "and placement"));
+       ((Fl_Scroll*) adrstk.WidgAddress)->end();
+ 
+       ST(AddrStack).pop_back();
+@@ -2601,10 +2611,12 @@ extern "C" {
+       ADDR_STACK adrstk = ST(AddrStack).back();
+       if (UNLIKELY(strcmp( adrstk.h->optext->t.opcod, "FLtabs")))
+         return
+-          csound->InitError(csound, Str("FLscroll_end: invalid stack pointer: "
++          csound->InitError(csound, "%s",
++                                    Str("FLscroll_end: invalid stack pointer: "
+                                         "verify its placement"));
+       if (UNLIKELY(adrstk.count != ST(stack_count)))
+-        return csound->InitError(csound, Str("FLtabs_end: invalid stack count: "
++        return csound->InitError(csound, "%s",
++                                         Str("FLtabs_end: invalid stack count: "
+                                              "verify FLtabs/FLtabs_end count and "
+                                              "placement"));
+       ((Fl_Scroll*) adrstk.WidgAddress)->end();
+@@ -2648,12 +2660,14 @@ extern "C" {
+       ST(stack_count)--;
+       ADDR_STACK adrstk = ST(AddrStack).back();
+       if (UNLIKELY(strcmp( adrstk.h->optext->t.opcod, "FLgroup")))
+-        return csound->InitError(csound, Str("FLgroup_end: invalid stack pointer: "
+-                                             "verify its placement"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLgroup_end: invalid stack pointer: "
++                                     "verify its placement"));
+       if (UNLIKELY(adrstk.count != ST(stack_count)))
+-        return csound->InitError(csound, Str("FLgroup_end: invalid stack count: "
+-                                             "verify FLgroup/FLgroup_end count and"
+-                                             " placement"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLgroup_end: invalid stack count: "
++                                     "verify FLgroup/FLgroup_end count and"
++                                     " placement"));
+       ((Fl_Scroll*) adrstk.WidgAddress)->end();
+ 
+       ST(AddrStack).pop_back();
+@@ -2681,12 +2695,14 @@ extern "C" {
+       ST(stack_count)--;
+       ADDR_STACK adrstk = ST(AddrStack).back();
+       if (UNLIKELY(strcmp( adrstk.h->optext->t.opcod, "FLpack")))
+-        return csound->InitError(csound, Str("FLpack_end: invalid stack pointer: "
+-                                             "verify its placement"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLpack_end: invalid stack pointer: "
++                                     "verify its placement"));
+       if (UNLIKELY(adrstk.count != ST(stack_count)))
+-        return csound->InitError(csound, Str("FLpack_end: invalid stack count: "
+-                                             "verify FLpack/FLpack_end count and "
+-                                             "placement"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLpack_end: invalid stack count: "
++                                     "verify FLpack/FLpack_end count and "
++                                     "placement"));
+       ((Fl_Pack*) adrstk.WidgAddress)->end();
+ 
+       ST(AddrStack).pop_back();
+@@ -2837,7 +2853,8 @@ extern "C" {
+ 
+       widgetType = fl_getWidgetTypeFromOpcodeName(csound, v.opcode);
+       if (UNLIKELY(widgetType == 4)) {
+-        csound->InitError(csound, Str("FLvalue cannot be set by FLsetVal.\n"));
++        csound->InitError(csound, "%s",
++                          Str("FLvalue cannot be set by FLsetVal.\n"));
+         return NOTOK;
+       }
+       if (widgetType < 0)
+@@ -2873,7 +2890,8 @@ extern "C" {
+ 
+       widgetType = fl_getWidgetTypeFromOpcodeName(csound, v.opcode);
+       if (UNLIKELY(widgetType == 4)) {
+-        csound->InitError(csound, Str("FLvalue cannot be set by FLsetVal\n"));
++        csound->InitError(csound, "%s",
++                          Str("FLvalue cannot be set by FLsetVal\n"));
+         return NOTOK;
+       }
+       if (widgetType < 0)
+@@ -3238,7 +3256,7 @@ extern "C" {
+         itype = itype - 20;
+       }
+       if (UNLIKELY(itype > 10 && iexp == EXP_)) {
+-        csound->Warning(csound,
++        csound->Warning(csound, "%s",
+                         Str("FLslider exponential, using non-labeled slider"));
+         itype -= 10;
+       }
+@@ -3260,7 +3278,7 @@ extern "C" {
+       case 4:  o->type(FL_VERT_SLIDER); break;
+       case 5:  o->type(FL_HOR_NICE_SLIDER); o->box(FL_FLAT_BOX); break;
+       case 6:  o->type(FL_VERT_NICE_SLIDER); o->box(FL_FLAT_BOX); break;
+-      default: return csound->InitError(csound,
++      default: return csound->InitError(csound, "%s",
+                                         Str("FLslider: invalid slider type"));
+       }
+       if (plastic) o->box(FL_PLASTIC_DOWN_BOX);
+@@ -3273,8 +3291,9 @@ extern "C" {
+         break;
+       case EXP_ : //exponential
+         if (UNLIKELY(min == 0 || max == 0))
+-          return csound->InitError(csound, Str("FLslider: zero is illegal "
+-                                               "in exponential operations"));
++          return csound->InitError(csound, "%s",
++                                   Str("FLslider: zero is illegal "
++                                       "in exponential operations"));
+         range = max - min;
+         o->range(0,range);
+         #if defined(sun)
+@@ -3334,7 +3353,8 @@ extern "C" {
+                    csound->zklast > (long)(*p->inumsliders + *p->ioutablestart_ndx)))
+           outable = csound->zkstart + (long) *p->ioutablestart_ndx;
+         else {
+-          return csound->InitError(csound, Str("invalid ZAK space allocation"));
++          return csound->InitError(csound, "%s",
++                                   Str("invalid ZAK space allocation"));
+         }
+       }
+       else {
+@@ -3448,8 +3468,9 @@ extern "C" {
+         case EXP_ : //exponential
+           if (UNLIKELY(min == 0 || max == 0))
+             return
+-              csound->InitError(csound, Str("FLslidBnk: zero is illegal "
+-                                            "in exponential operations"));
++              csound->InitError(csound, "%s",
++                                Str("FLslidBnk: zero is illegal "
++                                    "in exponential operations"));
+           range = max - min;
+           o->range(0,range);
+           #if defined(sun)
+@@ -3545,8 +3566,9 @@ extern "C" {
+         o->xbounds(*p->iminx,*p->imaxx); break;
+       case EXP_: //exponential
+         { if (UNLIKELY(*p->iminx == 0 || *p->imaxx == 0))
+-            return csound->InitError(csound, Str("FLjoy X axe: zero is illegal "
+-                                                 "in exponential operations"));
++            return csound->InitError(csound, "%s",
++                                     Str("FLjoy X axe: zero is illegal "
++                                         "in exponential operations"));
+           MYFLT range = *p->imaxx - *p->iminx;
+           o->xbounds(0,range);
+           #if defined(sun)
+@@ -3578,8 +3600,9 @@ extern "C" {
+         o->ybounds(*p->imaxy,*p->iminy); break;
+       case EXP_ : //exponential
+         { if (UNLIKELY(*p->iminy == 0 || *p->imaxy == 0))
+-            return csound->InitError(csound, Str("FLjoy X axe: zero is illegal "
+-                                                 "in exponential operations"));
++            return csound->InitError(csound, "%s",
++                                     Str("FLjoy X axe: zero is illegal "
++                                         "in exponential operations"));
+           MYFLT range = *p->imaxy - *p->iminy;
+           o->ybounds(range,0);
+           #if defined(sun)
+@@ -3672,7 +3695,8 @@ extern "C" {
+         o->box(_FL_OSHADOW_BOX);
+         break;
+       default:
+-        return csound->InitError(csound, Str("FLknob: invalid knob type"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLknob: invalid knob type"));
+       }
+       widget_attributes(csound, o);
+       o->align(FL_ALIGN_BOTTOM | FL_ALIGN_WRAP);
+@@ -3687,8 +3711,9 @@ extern "C" {
+         {
+           MYFLT min = p->min = *p->imin, max = *p->imax;
+           if (UNLIKELY(min == 0 || max == 0))
+-            return csound->InitError(csound, Str("FLknob: zero is illegal "
+-                                                 "in exponential operations"));
++            return csound->InitError(csound, "%s",
++                                     Str("FLknob: zero is illegal "
++                                         "in exponential operations"));
+           MYFLT range = max - min;
+           o->range(0,range);
+           #if defined(sun)
+@@ -3828,7 +3853,8 @@ extern "C" {
+         }
+         break;
+       default:
+-        return csound->InitError(csound, Str("FLbutton: invalid button type"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLbutton: invalid button type"));
+       }
+       Fl_Button *o = w;
+       o->align(FL_ALIGN_WRAP);
+@@ -3860,8 +3886,9 @@ extern "C" {
+ 
+       ADDR_STACK adrstk = ST(AddrStack).back();
+       if (UNLIKELY(strcmp( adrstk.h->optext->t.opcod, "FLpanel")))
+-        return csound->InitError(csound, Str("FLcloseButton: invalid stack"
+-                                             " pointer: verify its placement"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLcloseButton: invalid stack"
++                                     " pointer: verify its placement"));
+ 
+       o->callback((Fl_Callback*) fl_callbackCloseButton,
+                   (void*) adrstk.WidgAddress);
+@@ -3951,8 +3978,9 @@ extern "C" {
+               w->down_box(FL_PLASTIC_DOWN_BOX);
+             }
+             break;
+-          default: return csound->InitError(csound, Str("FLbuttonBank: "
+-                                                        "invalid button type"));
++          default: return csound->InitError(csound, "%s",
++                                            Str("FLbuttonBank: "
++                                                "invalid button type"));
+           }
+           widget_attributes(csound, w);
+           w->type(FL_RADIO_BUTTON);
+@@ -4056,7 +4084,8 @@ extern "C" {
+         o->type(FL_VERTICAL);
+         break;
+       default:
+-        return csound->InitError(csound, Str("FLroller: invalid roller type"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLroller: invalid roller type"));
+       }
+       widget_attributes(csound, o);
+       o->step(istep);
+@@ -4069,8 +4098,9 @@ extern "C" {
+         {
+           MYFLT min = p->min, max = *p->imax;
+           if (UNLIKELY(min == 0 || max == 0))
+-            return csound->InitError(csound, Str("FLslider: zero is illegal "
+-                                                 "in exponential operations"));
++            return csound->InitError(csound, "%s",
++                                     Str("FLslider: zero is illegal "
++                                         "in exponential operations"));
+           MYFLT range = max - min;
+           o->range(0,range);
+           #if defined(sun)
+@@ -4251,8 +4281,9 @@ extern "C" {
+   static int fl_hvsbox(CSOUND *csound,FL_HVSBOX *p)
+   {
+       if (UNLIKELY(*p->numlinesX < 2 || *p->numlinesY < 2))
+-        return csound->InitError(csound, Str("FLhvsBox: a square area must be"
+-                                             " delimited by 2 lines at least"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLhvsBox: a square area must be"
++                                     " delimited by 2 lines at least"));
+ 
+       HVS_BOX *o =  new HVS_BOX((int) *p->numlinesX,(int)  *p->numlinesY,
+                                 (int) *p->ix,(int)  *p->iy,
+@@ -4299,10 +4330,12 @@ extern "C" {
+         if (LIKELY((ftp = csound->FTFind(csound,p->ifn)) != NULL))
+           p->table = ftp->ftable;
+         else {
+-          return csound->InitError(csound, Str("FLkeyIn: invalid table number"));
++          return csound->InitError(csound, "%s",
++                                   Str("FLkeyIn: invalid table number"));
+         }
+         if (UNLIKELY(ftp->flen < 512)) {
+-          return csound->InitError(csound, Str("FLkeyIn: table too short!"));
++          return csound->InitError(csound, "%s",
++                                   Str("FLkeyIn: table too short!"));
+         }
+       }
+       else p->flag = 0;
+@@ -4396,7 +4429,8 @@ extern "C" {
+                    csound->zklast>(long)(*p->inumsliders + *p->ioutablestart_ndx)))
+           outable = csound->zkstart + (long) *p->ioutablestart_ndx;
+         else {
+-          return csound->InitError(csound, Str("invalid ZAK space allocation"));
++          return csound->InitError(csound, "%s",
++			           Str("invalid ZAK space allocation"));
+         }
+       }
+       else {
+@@ -4519,8 +4553,9 @@ extern "C" {
+         case EXP_ : //exponential
+           if (UNLIKELY(min == 0 || max == 0))
+             return
+-              csound->InitError(csound, Str("FLvslidBnk: zero is illegal "
+-                                            "in exponential operations"));
++              csound->InitError(csound, "%s",
++                                Str("FLvslidBnk: zero is illegal "
++                                    "in exponential operations"));
+           range = max - min;
+           o->range(range,0);
+           #if defined(sun)
+@@ -4607,7 +4642,8 @@ extern "C" {
+                    csound->zklast>(long)(*p->inumsliders + *p->ioutablestart_ndx)))
+           outable = csound->zkstart + (long) *p->ioutablestart_ndx;
+         else {
+-          return csound->InitError(csound, Str("invalid ZAK space allocation"));
++          return csound->InitError(csound, "%s",
++                                   Str("invalid ZAK space allocation"));
+         }
+       }
+       else {
+@@ -4644,7 +4680,7 @@ extern "C" {
+           slider_type = slider_type - 20;
+         }
+         if (UNLIKELY(slider_type > 10 && iexp == EXP_)) {
+-          csound->Warning(csound,
++          csound->Warning(csound, "%s",
+                           Str("FLslider exponential, using non-labeled slider"));
+           slider_type -= 10;
+         }
+@@ -4695,8 +4731,9 @@ extern "C" {
+         case EXP_ : //exponential
+           if (UNLIKELY(min == 0 || max == 0))
+             return
+-              csound->InitError(csound, Str("FLsliderBank: zero is illegal "
+-                                            "in exponential operations"));
++              csound->InitError(csound, "%s",
++                                Str("FLsliderBank: zero is illegal "
++                                    "in exponential operations"));
+           range = max - min;
+           o->range(0,range);
+           #if defined(sun)
+@@ -4784,7 +4821,8 @@ extern "C" {
+                    csound->zklast>(long)(*p->inumsliders + *p->ioutablestart_ndx)))
+           outable = csound->zkstart + (long) *p->ioutablestart_ndx;
+         else {
+-          return csound->InitError(csound, Str("invalid ZAK space allocation"));
++          return csound->InitError(csound, "%s",
++                                   Str("invalid ZAK space allocation"));
+         }
+       }
+       else {
+@@ -4822,8 +4860,9 @@ extern "C" {
+           slider_type -= 20;
+         }
+         if (UNLIKELY(slider_type > 10 && iexp == EXP_)) {
+-          csound->Warning(csound, Str("FLslidBnk2: FLslider exponential, "
+-                                      "using non-labeled slider"));
++          csound->Warning(csound, "%s",
++                          Str("FLslidBnk2: FLslider exponential, "
++                              "using non-labeled slider"));
+           slider_type -= 10;
+         }
+         if (slider_type <= 10)
+@@ -4872,8 +4911,9 @@ extern "C" {
+         case EXP_ : //exponential
+           if (UNLIKELY(min == 0 || max == 0))
+             return
+-              csound->InitError(csound, Str("FLsliderBank: zero is illegal "
+-                                            "in exponential operations"));
++              csound->InitError(csound, "%s",
++                                Str("FLsliderBank: zero is illegal "
++                                    "in exponential operations"));
+           range = max - min;
+           o->range(range,0);
+           #if defined(sun)
+@@ -4952,23 +4992,25 @@ extern "C" {
+       if (LIKELY((ftp = csound->FTFind(csound, p->ifn)) != NULL))
+         table = ftp->ftable;
+       else {
+-        return csound->InitError(csound, Str("FLsldBnkSet: invalid table number"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLsldBnkSet: invalid table number"));
+       }
+       // *startInd, *startSlid, *numSlid
+       if (UNLIKELY( ftp->flen < startInd + numslid)) {
+-        return csound->InitError(csound, Str("FLslidBnkSet: table too short!"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLslidBnkSet: table too short!"));
+       }
+       FLSLIDERBANK *q = (FLSLIDERBANK *)ST(AddrSetValue)[ (int) *p->ihandle].opcode;
+ 
+       if (LIKELY((ftp = csound->FTFind(csound, q->ioutable)) != NULL))
+         outable = ftp->ftable;
+       else {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLsldBnkSet: invalid outable number"));
+       }
+       if (numslid == 0) numslid = (int)(q->elements - *p->startSlid);
+       if (UNLIKELY( q->elements > startSlid + numslid)) {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLslidBnkSet: too many sliders to reset!"));
+       }
+       for (int j = startSlid, k = startInd; j< numslid + startSlid; j++, k++) {
+@@ -4992,8 +5034,9 @@ extern "C" {
+           }
+           break;
+         default:
+-          return csound->InitError(csound, Str("FLslidBnkSet: "
+-                                               "function mapping not available"));
++          return csound->InitError(csound, "%s",
++                                   Str("FLslidBnkSet: "
++                                       "function mapping not available"));
+         }
+ 
+         FLlock();
+@@ -5015,11 +5058,13 @@ extern "C" {
+       if (LIKELY((ftp = csound->FTFind(csound, p->ifn)) != NULL))
+         table = ftp->ftable;
+       else {
+-        return csound->InitError(csound, Str("FLsldBnkSet: invalid table number"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLsldBnkSet: invalid table number"));
+       }
+       // *startInd, *startSlid, *numSlid
+       if (UNLIKELY( ftp->flen < startInd + numslid)) {
+-        return csound->InitError(csound, Str("FLslidBnkSet: table too short!"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLslidBnkSet: table too short!"));
+       }
+       FLSLIDERBANK2 *q =
+         (FLSLIDERBANK2 *)ST(AddrSetValue)[ (int) *p->ihandle].opcode;
+@@ -5027,13 +5072,13 @@ extern "C" {
+       if (LIKELY((ftp = csound->FTFind(csound, q->ioutable)) != NULL))
+         outable = ftp->ftable;
+       else {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLsldBnkSet: invalid outable number"));
+       }
+ 
+       if (numslid == 0) numslid = (int)(q->elements - *p->startSlid);
+       if (UNLIKELY( q->elements > startSlid + numslid)) {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLslidBnkSet: too many sliders to reset!"));
+       }
+ 
+@@ -5061,9 +5106,10 @@ extern "C" {
+           {
+             //      val = table[k];
+             if (UNLIKELY(val < 0 || val > 1)) { // input range must be 0 to 1
+-              csound->PerfError(csound, Str("FLslidBnk2Setk: value out of range: "
+-                                            "function mapping requires a 0 to 1 "
+-                                            "range for input"));
++              csound->PerfError(csound, "%s",
++                                Str("FLslidBnk2Setk: value out of range: "
++                                    "function mapping requires a 0 to 1 "
++                                    "range for input"));
+             }
+           }
+           //{
+@@ -5090,24 +5136,26 @@ extern "C" {
+       if (LIKELY((ftp = csound->FTFind(csound, p->ifn)) != NULL))
+         p->table = ftp->ftable;
+       else {
+-        return csound->InitError(csound, Str("FLsldBnkSetk: invalid table number"));
++        return csound->InitError(csound, "%s",
++                                  Str("FLsldBnkSetk: invalid table number"));
+       }
+       // *startInd, *startSlid, *numSlid
+       if (UNLIKELY( ftp->flen < p->startind + p->numslid)) {
+-        return csound->InitError(csound, Str("FLslidBnkSetk: table too short!"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLslidBnkSetk: table too short!"));
+       }
+       p->q = (FLSLIDERBANK2 *) ST(AddrSetValue)[ (int) *p->ihandle].opcode;
+ 
+       if (LIKELY((ftp = csound->FTFind(csound, p->q->ioutable)) != NULL))
+         p->outable = ftp->ftable;
+       else {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLsldBnkSetk: invalid outable number"));
+       }
+ 
+       if (p->numslid == 0) p->numslid = p->q->elements - p->startslid;
+       if (UNLIKELY( p->q->elements < p->startslid + p->numslid)) {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLslidBnkSetk: too many sliders to reset!"));
+       }
+       return OK;
+@@ -5146,9 +5194,10 @@ extern "C" {
+             {
+               val = table[k];
+               if (UNLIKELY(val < 0 || val > 1)) { // input range must be 0 to 1
+-                csound->PerfError(csound, Str("FLslidBnk2Setk: value out of range:"
+-                                              " function mapping requires a 0 to 1"
+-                                              " range for input"));
++                csound->PerfError(csound, "%s",
++                                  Str("FLslidBnk2Setk: value out of range:"
++                                      " function mapping requires a 0 to 1"
++                                      " range for input"));
+               }
+             }
+           }
+@@ -5175,25 +5224,26 @@ extern "C" {
+       if (LIKELY((ftp = csound->FTFind(csound, p->ifn)) != NULL))
+         p->table = ftp->ftable;
+       else {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLslidBnkSetk: invalid table number"));
+       }
+       // *startInd, *startSlid, *numSlid
+       if (UNLIKELY( ftp->flen < p->startind + p->numslid)) {
+-        return csound->InitError(csound, Str("FLslidBnkSetk: table too short!"));
++        return csound->InitError(csound, "%s",
++                                 Str("FLslidBnkSetk: table too short!"));
+       }
+       p->q = (FLSLIDERBANK *) ST(AddrSetValue)[ (int) *p->ihandle].opcode;
+ 
+       if (LIKELY((ftp = csound->FTFind(csound, p->q->ioutable)) != NULL))
+         p->outable = ftp->ftable;
+       else {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLslidBnkSetk: invalid outable number"));
+       }
+ 
+       if (p->numslid == 0) p->numslid = p->q->elements - p->startslid;
+       if (UNLIKELY( p->q->elements < p->startslid + p->numslid)) {
+-        return csound->InitError(csound,
++        return csound->InitError(csound, "%s",
+                                  Str("FLslidBnkSetk: too many sliders to reset!"));
+       }
+       return OK;
+@@ -5232,7 +5282,7 @@ extern "C" {
+             {
+               val = table[k];
+               if (UNLIKELY(val < 0 || val > 1)) { // input range must be 0 to 1
+-                csound->PerfError(csound,
++                csound->PerfError(csound, "%s",
+                                   Str("FLslidBnk2Setk: value out of range: "
+                                       "function mapping requires a 0 to 1 range "
+                                       "for input"));
+@@ -5265,6 +5315,7 @@ extern "C" {
+         p->expx = EXP_;
+         if (UNLIKELY(*p->ioutx_min == 0 || *p->ioutx_max==0))
+           return csound->InitError(csound,
++                                   "%s",
+                                    Str("FLxyin: none of X limits can be zero in"
+                                        " exponential mode!"));
+         p->basex = pow((double) (*p->ioutx_max / *p->ioutx_min),
+@@ -5291,8 +5342,9 @@ extern "C" {
+       case -1: // EXP
+         p->expy = EXP_;
+         if (UNLIKELY(*p->iouty_min == 0 || *p->iouty_max==0))
+-          return csound->InitError(csound, Str("FLxyin: none of Y limits can "
+-                                               "be zero in exponential mode!"));
++          return csound->InitError(csound, "%s",
++                                   Str("FLxyin: none of Y limits can "
++                                       "be zero in exponential mode!"));
+         p->basey = pow((double) (*p->iouty_max / *p->iouty_min),
+                        (double) (1/p->rangey));
+         break;
+diff --git a/InOut/winFLTK.c b/InOut/winFLTK.c
+index e73a7ed..658d31e 100644
+--- a/InOut/winFLTK.c
++++ b/InOut/winFLTK.c
+@@ -74,7 +74,7 @@ PUBLIC int csoundModuleInit(CSOUND *csound)
+                                     "FLTK_Flags") == (void*) 0) {
+       if (csound->CreateGlobalVariable(csound,
+                                        "FLTK_Flags", sizeof(int)) != 0)
+-        csound->Die(csound,
++        csound->Die(csound, "%s",
+                     Str("widgets.cpp: error allocating FLTK flags"));
+       initFlags = 1;
+     }
+diff --git a/frontends/CsoundAC/Counterpoint.cpp b/frontends/CsoundAC/Counterpoint.cpp
+index cd44e00..137128c 100644
+--- a/frontends/CsoundAC/Counterpoint.cpp
++++ b/frontends/CsoundAC/Counterpoint.cpp
+@@ -97,13 +97,13 @@ void Counterpoint::toCsoundScore(std::string filename, double secondsPerPulse)
+           key = double(Ctrpt(note,voice));
+           sprintf(buffer, "i %d %-1.7g %-1.7g %-1.7g %-1.7g %-1.7g %-1.7g %-1.7g %-1.7g %-1.7g\n",
+                   (int)(voice + 1), time, duration, key, velocity, phase, x, y, z, pcs);
+-          fprintf(stderr, buffer);
++          fprintf(stderr, "%s", buffer);
+           stream << buffer;
+           totalnotes++;
+         }
+     }
+   sprintf(buffer, "; Total notes = %d\n", totalnotes);
+-  fprintf(stderr, buffer);
++  fprintf(stderr, "%s", buffer);
+   stream << buffer;
+ }
+ 
+diff --git a/frontends/CsoundAC/System.cpp b/frontends/CsoundAC/System.cpp
+index d5721d5..ac5fab9 100644
+--- a/frontends/CsoundAC/System.cpp
++++ b/frontends/CsoundAC/System.cpp
+@@ -44,7 +44,7 @@ namespace csound
+ 
+   void Logger::write(const char *text)
+   {
+-    fprintf(stderr, text);
++    fprintf(stderr, "%s", text);
+   }
+ 
+   ThreadLock::ThreadLock() : lock(0)
+-- 
+1.7.7.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 65c5d0e..c4acae3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+0000-fix-ftbfs-format-security.diff
 1000-use-system-stk.diff
 1003-abi-plugin-dir.diff
 1004-fix-csoundac-csnd-linkage.diff

-- 
csound packaging



More information about the pkg-multimedia-commits mailing list