Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd2d4cd9

Browse files
atherielkalibera
andcommitted
Fix potential memory corruption by adding a PROTECT() call.
Co-authored-by: Tomas Kalibera <tomas.kalibera@gmail.com>Signed-off-by: Aaron Jacobs <atheriel@gmail.com>
1 parent496663e commitd2d4cd9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

‎NEWS.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#log4r 0.4.2.9000
2+
3+
* Fixes a potential memory corruption issue identified by rchk. Thanks to Tomas
4+
Kalibera for the associated patch.
5+
16
#log4r 0.4.2
27

38
* Fixes a crash where`logfmt_log_layout()` would not correctly handle memory

‎src/logfmt.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ SEXP R_encode_logfmt(SEXP list)
7171
if (len==0||keys==R_NilValue) {
7272
returnR_BlankScalarString;
7373
}
74+
PROTECT(keys);
7475
char*buffer=NULL;
7576
buf_grow(buffer,256);
7677

@@ -181,5 +182,6 @@ SEXP R_encode_logfmt(SEXP list)
181182
buf_push(buffer,'\n');
182183
SEXPout=Rf_ScalarString(Rf_mkCharLen(buffer,buf_size(buffer)));
183184
buf_free(buffer);
185+
UNPROTECT(1);
184186
returnout;
185187
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp