[SERVER-57206] Compiler warnings in JSStringWrapper::JSStringWrapper Created: 26/May/21  Updated: 29/Oct/23  Resolved: 04/Jun/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Yingdong Yuan Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-47391 Coverity analysis defect 114099: Copy... Closed
Related
related to SERVER-46916 Make misc. map reduce performance imp... Closed
is related to SERVER-57371 ItoA should be able to write to a use... Backlog
Backwards Compatibility: Fully Compatible
Sprint: Dev Platform 2021-06-14
Participants:

 Description   

I got a compiler warning below when building from source

In file included from /usr/include/string.h:494,
from /usr/include/c++/9/cstring:42,
from src/third_party/mozjs-60/include/mozilla/Span.h:33,
from src/third_party/mozjs-60/include/mozilla/Range.h:12,
from src/third_party/mozjs-60/include/jsapi.h:15,
from src/mongo/scripting/mozjs/jsstringwrapper.h:33,
from src/mongo/scripting/mozjs/jsstringwrapper.cpp:32:
In function 'char* strncpy(char*, const char*, size_t)',
inlined from 'mongo::mozjs::JSStringWrapper::JSStringWrapper(int32_t)' at src/mongo/scripting/mozjs/jsstringwrapper.cpp:48:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 64 equals destination size [-Werror=stringop-truncation]
106 | return _builtin_strncpy_chk (dest, __src, __len, __bos (_dest));

~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 04/Jun/21 ]

Author:

{'name': 'yingdongyuan', 'email': 'yingdongyuan@deeproute.ai'}

Message: SERVER-57206 Resolve Compiler warnings in JSStringWrapper::JSStringWrapper

Signed-off-by: Andrew Morrow <acm@mongodb.com>

Closes #1404
Branch: master
https://github.com/mongodb/mongo/commit/285b313a0571fc6b648f123277cbdce3d0202a2d

Comment by Kelsey Schubert [ 28/May/21 ]

Thanks for the ticket and opening a pull request, we'll take a look!

Comment by Yingdong Yuan [ 26/May/21 ]

I created a pr for this in https://github.com/mongodb/mongo/pull/1404, please review it.

Generated at Thu Feb 08 05:41:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.