Skip to content

Commit ac8a3b7

Browse files
Andreas BlätteAndreas Blätte
authored andcommitted
from sprintf to snprintf PolMine#70
1 parent 8bbf683 commit ac8a3b7

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: RcppCWB
22
Type: Package
33
Title: 'Rcpp' Bindings for the 'Corpus Workbench' ('CWB')
4-
Version: 0.5.4
5-
Date: 2022-08-30
4+
Version: 0.5.4.9001
5+
Date: 2023-01-24
66
Author: Andreas Blaette [aut, cre],
77
Bernard Desgraupes [aut],
88
Sylvain Loiseau [aut],
@@ -45,7 +45,7 @@ SystemRequirements: GNU make, pcre (>= 7 < 10), GLib (>= 2.0.0). On Windows, no
4545
(<https://github.com/PolMine/libcl>) during installation. On macOS, static libraries of Glib are downloaded
4646
(<https://github.com/PolMine/libglib>) if Glib is not present.
4747
Imports:
48-
Rcpp (>= 1.0.7),
48+
Rcpp (>= 1.0.10),
4949
fs
5050
Suggests:
5151
knitr,

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# RcppCWB 0.5.5
2+
3+
* C++ code replaces `sprintf()` with `snprintf()` to address security issue.
4+
* Package now depends on Rcpp v1.0.10, which replaces one remaining `sprintf()`
5+
#70.
6+
7+
18
# RcppCWB 0.5.4
29

310
* Fixed package configuration that prevented that compiler is used for compiling

src/cqp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ SEXP cqp_query(SEXP corpus, SEXP subcorpus, SEXP query){
132132
int len = strlen(child) + strlen(q) + 10;
133133
cqp_query = (char *) cl_malloc(len);
134134

135-
sprintf(cqp_query, "%s = %s", child, q);
135+
snprintf(cqp_query, len, "%s = %s", child, q);
136136

137137
if (!cqi_activate_corpus(mother)){
138138
Rprintf("activation failed");

0 commit comments

Comments
 (0)