Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
utilities
pinfo
23c169877fda839f0634b2d193eaf26de290f141.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 23c169877fda839f0634b2d193eaf26de290f141.patch of Package pinfo
From 23c169877fda839f0634b2d193eaf26de290f141 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw <bas.zoetekouw@surfnet.nl> Date: Thu, 23 Jul 2020 20:39:04 +0200 Subject: [PATCH] workaround false positie in gcc-10 stringop-overflow checks --- src/utils.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/utils.c b/src/utils.c index cb2fe76..2e4139c 100644 --- a/src/utils.c +++ b/src/utils.c @@ -848,10 +848,9 @@ char * make_tempfile() { char *filename; - size_t len; /* TODO: fix hardcoded /tmp */ - char tmpfile_template[] = "/tmp/pinfo.XXXXXX"; + char tmpfile_template[32] = "/tmp/pinfo.XXXXXX"; /* create a tmpfile */ int fd = mkstemp(tmpfile_template); @@ -864,9 +863,8 @@ make_tempfile() } /* allocate a new string and copy the filename there */ - len = strlen(tmpfile_template)+1; - filename = xmalloc(len+1); /* guarenteerd to be set to \0's */ - strncpy(filename, tmpfile_template, len); + filename = xmalloc(33); /* guarenteerd to be set to \0's */ + strncpy(filename, tmpfile_template, 32); /* close the file */ close(fd);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor