Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
L
lalsuite
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 105
    • Issues 105
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 24
    • Merge Requests 24
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • lscsoft
  • lalsuite
  • Merge Requests
  • !1280

Merged
Opened Mar 31, 2020 by Leo Pound Singer@leo-singerContributor1 of 4 tasks completed1/4 tasks

Fix format overflow on gcc 8 in coinj.c

  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1

Description

Fix format overflow on gcc 8 in coinj.c.

Fixes this error:

In file included from /opt/local/lib/gcc8/gcc/x86_64-apple-darwin19/8.4.0/include-fixed/stdio.h:421,
                 from coinj.c:20:
coinj.c: In function 'main':
coinj.c:380:29: error: '%s' directive writing up to 29 bytes into a region of size between 0 and 1014 [-Werror=format-overflow=]
         sprintf(outfilename,"%s%s%i_CBC_%s_%i_%s_%s.txt",outputpath,"/",inj_epoch.gpsSeconds,massBin,inj_num,injtype,det_name);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                     ~~~~~~~
coinj.c:380:9: note: '__builtin___sprintf_chk' output between 16 and 1077 bytes into a destination of size 1024
         sprintf(outfilename,"%s%s%i_CBC_%s_%i_%s_%s.txt",outputpath,"/",inj_epoch.gpsSeconds,massBin,inj_num,injtype,det_name);
         ^~~~~~~
coinj.c:434:23: error: '_HWINJ_STRAIN-' directive writing 14 bytes into a region of size between 0 and 1017 [-Werror=format-overflow=]
         sprintf(fname,"%s%s%s-INSP%i_HWINJ_STRAIN-%i-%i.gwf",outputpath,"/",det_name, inj_num, inj_epoch.gpsSeconds, (UINT4)injLength);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coinj.c:434:9: note: '__builtin___sprintf_chk' output between 31 and 1059 bytes into a destination of size 1024
         sprintf(fname,"%s%s%s-INSP%i_HWINJ_STRAIN-%i-%i.gwf",outputpath,"/",det_name, inj_num, inj_epoch.gpsSeconds, (UINT4)injLength);
         ^~~~~~~

API Changes and Justification

Backwards Compatible Changes

  • This change introduces no API changes
  • This change adds new API calls

Backwards Incompatible Changes

  • This change modifies an existing API
  • This change removes an existing API

If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.

Review Status

This is a trivial error handling bug fix, so I don't think that it requires review.

Assignee
Assign to
Reviewer
Request review from
lalapps-6.25.2
Milestone
lalapps-6.25.2
Assign milestone
Time tracking
Reference: lscsoft/lalsuite!1280
Source branch: coinc-format-overflow

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.