starsofchance/CVEfixes_v1.0.8 huggingface dataset:
CVE-2023-43320 (published 2023-09-27T23:15Z)

An issue in Proxmox Server Solutions GmbH Proxmox VE v.5.4 thru v.8.0, Proxmox Backup Server v.1.1 thru v.3.0, and Proxmox Mail Gateway v.7.1 thru v.8.0 allows a remote authenticated attacker to escalate privileges via bypassing the two-factor authentication component.

CVSS v3 base score: 8.8, HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: NVD-CWE-noinfo
cwe_name: Insufficient Information
description: There is insufficient information about the issue to classify it; details are unkown or unspecified.
extended_description: Insufficient Information

Fix information:
repo_url: https://github.com/proxmox/proxmox-rs
commit_details: repo_url: https://github.com/proxmox/proxmox-rs
author: Wolfgang Bumiller
author_date: 2023-04-20 16:08:00+02:00
msg: tfa: add data for rate limiting and blocking

TfaUserData uses `#[serde(deny_unknown_fields)]`, so we add
this now, but using it will require explicitly enabling it.

If the TOTP count is high, the user should be locked out of
TOTP entirely until they use a recovery key to reset the
count.

If a user's TFA try count is too high, they should get rate
limited.

In both cases they should receive some kind of notification.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
repository: repo_url: https://github.com/proxmox/proxmox-rs
repo_name: proxmox/proxmox-rs
description: Proxmox Common Rust Crates
repo_language: Rust
owner: proxmox
file_changes: filename: mod.rs
change_type: ModificationType.MODIFY
diff: @@ -331,6 +331,15 @@ pub struct TfaUserData {
     /// available for PVE, where the yubico API server configuration is part if the realm.
     #[serde(skip_serializing_if = "Vec::is_empty", default)]
     pub yubico: Vec<TfaEntry<String>>,
+
+    /// Once a user runs into a TOTP limit they get locked out of TOTP until they successfully use
+    /// a recovery key.
+    #[serde(skip_serializing_if = "bool_is_false", default)]
+    pub totp_locked: bool,
+
+    /// If a user hits too many 2nd factor failures, they get completely blocked for a while.
+    #[serde(skip_serializing_if = "Option::is_none", default)]
+    pub tfa_blocked_until: Option<i64>,
 }
 
 impl TfaUserData {
@@ -924,6 +933,19 @@ pub struct TfaUserChallenges {
     #[serde(skip_serializing_if = "Vec::is_empty", default)]
     #[serde(deserialize_with = "filter_expired_challenge")]
     webauthn_auths: Vec<WebauthnAuthChallenge>,
+
+    /// Number of consecutive TOTP failures. Too many of those will lock out a user.
+    #[serde(skip_serializing_if = "u32_is_zero", default)]
+    totp_failures: u32,
+
+    /// Number of consecutive 2nd factor failures. When the limit is reached, the user is locked
+    /// out for 12 hours.
+    #[serde(skip_serializing_if = "u32_is_zero", default)]
+    tfa_failures: u32,
+}
+
+fn u32_is_zero(n: &u32) -> bool {
+    *n == 0
 }
 
 /// Serde helper using our `FilteredVecVisitor` to filter out expired entries directly at load

programming_language: Rust
CVE-2023-0297 (published 2023-01-14T03:15Z)

Code Injection in GitHub repository pyload/pyload prior to 0.5.0b3.dev31.

CVSS v3 base score: 9.8, CRITICAL (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-94
cwe_name: Improper Control of Generation of Code ('Code Injection')
description: The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
extended_description: 
            When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. Such an alteration could lead to arbitrary code execution.
            Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.
         
         

Fix information:
repo_url: https://github.com/pyload/pyload
commit_details: repo_url: https://github.com/pyload/pyload
author: GammaC0de
author_date: 2023-01-03 22:56:42+02:00
msg: fix arbitrary python code execution by abusing js2py functionality
repository: repo_url: https://github.com/pyload/pyload
repo_name: pyload/pyload
description: The free and open-source Download Manager written in pure Python
repo_language: Python
owner: pyload
file_changes: filename: misc.py
change_type: ModificationType.MODIFY
diff: @@ -1,12 +1,11 @@
 # -*- coding: utf-8 -*-
 
 import random
-import socket
 import string
 
 import js2py
 
-from .check import is_mapping
+js2py.disable_pyimport()
 
 
 def random_string(length):

programming_language: Python
CVE-2014-2209 (published 2014-12-28T15:59Z)

Facebook HipHop Virtual Machine (HHVM) before 3.1.0 does not drop supplemental group memberships within hphp/util/capability.cpp and hphp/util/light-process.cpp, which allows remote attackers to bypass intended access restrictions by leveraging group permissions for a file or directory.

Severity: MEDIUM
CVSS v2 base score: 5.0 (AV:N/AC:L/Au:N/C:N/I:P/A:N)

Weakness information:
cwe_id: CWE-264
cwe_name: Permissions, Privileges, and Access Controls
description: Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.

Fix information:
repo_url: https://github.com/facebook/hhvm
commit_details: repo_url: https://github.com/facebook/hhvm
author: Otto Ebeling
author_date: 2014-04-28 11:19:44-07:00
msg: Drop supplementary groups when changing to non-root

Summary: When running HHVM as a non-root user, UID and GID are updated correctly but supplementary groups are not dropped properly. This runs initgroups inside main thread and lightprocess threads to reset groups to those of the specified non-root user.

Reviewed By: @markw65

Differential Revision: D1193229
repository: repo_url: https://github.com/facebook/hhvm
repo_name: facebook/hhvm
description: A virtual machine for executing programs written in Hack.
repo_language: Hack
owner: facebook
file_changes: filename: capability.cpp
change_type: ModificationType.MODIFY
diff: @@ -24,6 +24,7 @@
 #include <sys/prctl.h>
 #include <sys/types.h>
 #include <pwd.h>
+#include <grp.h>
 
 namespace HPHP {
 ///////////////////////////////////////////////////////////////////////////////
@@ -102,6 +103,12 @@ bool Capability::ChangeUnixUser(uid_t uid) {
       return false;
     }
 
+    if (initgroups(pw->pw_name, pw->pw_gid) < 0) {
+      Logger::Error("unable to drop supplementary group privs: %s",
+                    folly::errnoStr(errno).c_str());
+      return false;
+    }
+
     if (pw->pw_gid == 0 || setgid(pw->pw_gid) < 0) {
       Logger::Error("unable to drop gid privs: %s",
                     folly::errnoStr(errno).c_str());

programming_language: C++
filename: light-process.cpp
change_type: ModificationType.MODIFY
diff: @@ -25,6 +25,7 @@
 #include <sys/socket.h>
 
 #include <afdt.h>
+#include <grp.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <poll.h>
@@ -299,6 +300,7 @@ static void do_change_user(FILE *fin, FILE *fout) {
     struct passwd *pw = getpwnam(uname.c_str());
     if (pw) {
       if (pw->pw_gid) {
+        initgroups(pw->pw_name, pw->pw_gid);
         setgid(pw->pw_gid);
       }
       if (pw->pw_uid) {

programming_language: C++
CVE-2016-10051 (published 2017-03-23T17:59Z)

Use-after-free vulnerability in the ReadPWPImage function in coders/pwp.c in ImageMagick 6.9.5-5 allows remote attackers to cause a denial of service (application crash) or have other unspecified impact via a crafted file.

Severity: MEDIUM
CVSS v2 base score: 6.8 (AV:N/AC:M/Au:N/C:P/I:P/A:P)
CVSS v3 base score: 7.8, HIGH (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-416
cwe_name: Use After Free
description: The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
extended_description: 
             
             
             
			 
             
             
         
         

Fix information:
repo_url: https://github.com/ImageMagick/ImageMagick
commit_details: repo_url: https://github.com/ImageMagick/ImageMagick
author: Cristy
author_date: 2016-08-05 16:35:07-04:00
msg: Prevent memory use after free
repository: repo_url: https://github.com/ImageMagick/ImageMagick
repo_name: ImageMagick/ImageMagick
description: 🧙‍♂️ ImageMagick 7
repo_language: C
owner: ImageMagick
file_changes: filename: ChangeLog
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,9 @@
   * Evaluate lazy pixel cache morphology to prevent buffer overflow (bug report
     from Ibrahim M. El-Sayed).
   * Prevent buffer overflow (bug report from Max Thrane).
+  * Prevent memory use after free (reference
+    https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=30245).
+
 
 2016-07-30  7.0.2-6 Cristy  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.2-6, GIT revision 18651:df24175:20160729.

programming_language: Markdown
filename: pwp.c
change_type: ModificationType.MODIFY
diff: @@ -247,8 +247,6 @@ static Image *ReadPWPImage(const ImageInfo *image_info,ExceptionInfo *exception)
     (void) close(unique_file);
   (void) RelinquishUniqueFileResource(read_info->filename);
   read_info=DestroyImageInfo(read_info);
-  (void) CloseBlob(pwp_image);
-  pwp_image=DestroyImage(pwp_image);
   if (EOFBlob(image) != MagickFalse)
     {
       char

programming_language: Matlab
CVE-2019-12109 (published 2019-05-15T23:29Z)

A Denial Of Service vulnerability in MiniUPnP MiniUPnPd through 2.1 exists due to a NULL pointer dereference in GetOutboundPinholeTimeout in upnpsoap.c for rem_port.

Severity: MEDIUM
CVSS v2 base score: 5.0 (AV:N/AC:L/Au:N/C:N/I:N/A:P)
CVSS v3 base score: 7.5, HIGH (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)

Weakness information:
cwe_id: CWE-476
cwe_name: NULL Pointer Dereference
description: The product dereferences a pointer that it expects to be valid but is NULL.
extended_description: 
            
            
            
         
         

Fix information:
repo_url: https://github.com/miniupnp/miniupnp
commit_details: repo_url: https://github.com/miniupnp/miniupnp
author: Thomas Bernard
author_date: 2018-12-18 23:47:54+01:00
msg: fix error from commit 13585f15c7f7dc28bbbba1661efb280d530d114c
repository: repo_url: https://github.com/miniupnp/miniupnp
repo_name: miniupnp/miniupnp
description: UPnP IGD implementation
repo_language: C
owner: miniupnp
file_changes: filename: upnpsoap.c
change_type: ModificationType.MODIFY
diff: @@ -1850,7 +1850,7 @@ GetOutboundPinholeTimeout(struct upnphttp * h, const char * action, const char *
 	rem_port = GetValueFromNameValueList(&data, "RemotePort");
 	protocol = GetValueFromNameValueList(&data, "Protocol");
 
-	if (!int_port || !ext_port || !protocol)
+	if (!int_port || !rem_port || !protocol)
 	{
 		ClearNameValueList(&data);
 		SoapError(h, 402, "Invalid Args");

programming_language: C
repo_url: https://github.com/miniupnp/miniupnp
commit_details: repo_url: https://github.com/miniupnp/miniupnp
author: Thomas Bernard
author_date: 2018-12-18 22:54:51+01:00
msg: GetOutboundPinholeTimeout: check args
repository: repo_url: https://github.com/miniupnp/miniupnp
repo_name: miniupnp/miniupnp
description: UPnP IGD implementation
repo_language: C
owner: miniupnp
file_changes: filename: upnpsoap.c
change_type: ModificationType.MODIFY
diff: @@ -1850,6 +1850,13 @@ GetOutboundPinholeTimeout(struct upnphttp * h, const char * action, const char *
 	rem_port = GetValueFromNameValueList(&data, "RemotePort");
 	protocol = GetValueFromNameValueList(&data, "Protocol");
 
+	if (!int_port || !ext_port || !protocol)
+	{
+		ClearNameValueList(&data);
+		SoapError(h, 402, "Invalid Args");
+		return;
+	}
+
 	rport = (unsigned short)atoi(rem_port);
 	iport = (unsigned short)atoi(int_port);
 	/*proto = atoi(protocol);*/

programming_language: C
CVE-2022-1706 (published 2022-05-17T18:15Z)

A vulnerability was found in Ignition where ignition configs are accessible from unprivileged containers in VMs running on VMware products. This issue is only relevant in user environments where the Ignition config contains secrets. The highest threat from this vulnerability is to data confidentiality. Possible workaround is to not put secrets in the Ignition config.

Severity: LOW
CVSS v2 base score: 3.5 (AV:N/AC:M/Au:S/C:P/I:N/A:N)
CVSS v3 base score: 6.5, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N)

Weakness information:
cwe_id: CWE-863
cwe_name: Incorrect Authorization
description: The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.
extended_description: 
            Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
            When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.
         
         

Fix information:
repo_url: https://github.com/coreos/ignition
commit_details: repo_url: https://github.com/coreos/ignition
author: Benjamin Gilbert
author_date: 2022-05-03 08:46:41-07:00
msg: Merge pull request #1350 from bgilbert/userdata

Delete userdata from VirtualBox/VMware after Ignition completes
repository: repo_url: https://github.com/coreos/ignition
repo_name: coreos/ignition
description: First boot installer and configuration tool
repo_language: Go
owner: coreos
CVE-2022-39397 (published 2022-11-22T21:15Z)

aliyun-oss-client is a rust client for Alibaba Cloud OSS. Users of this library will be affected, the incoming secret will be disclosed unintentionally. This issue has been patched in version 0.8.1.

CVSS v3 base score: 4.3, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N)

Weakness information:
cwe_id: NVD-CWE-Other
cwe_name: Other
description: NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
extended_description: Insufficient Information

Fix information:
repo_url: https://github.com/tu6ge/oss-rs
commit_details: repo_url: https://github.com/tu6ge/oss-rs
author: tu6ge
author_date: 2022-11-08 17:16:41+08:00
msg: fix(auth): Prevent secret exposure
repository: repo_url: https://github.com/tu6ge/oss-rs
repo_name: tu6ge/oss-rs
description: 一个阿里云 OSS 的 rust 客户端
repo_language: Rust
owner: tu6ge
file_changes: filename: auth.rs
change_type: ModificationType.MODIFY
diff: @@ -177,7 +177,7 @@ impl Default for VERB {
 }
 
 #[cfg_attr(test, automock)]
-pub trait AuthToHeaderMap {
+pub(crate) trait AuthToHeaderMap {
     fn get_original_header(&self) -> HeaderMap;
     fn get_header_key(&self) -> OssResult<HeaderValue>;
     fn get_header_secret(&self) -> OssResult<HeaderValue>;
@@ -255,7 +255,7 @@ impl AuthToOssHeader for Auth {
 }
 
 /// 从 auth 中提取各个字段，用于计算签名的原始字符串
-pub trait AuthSignString {
+pub(crate) trait AuthSignString {
     fn key(&self) -> Cow<'_, KeyId>;
     fn secret(&self) -> Cow<'_, KeySecret>;
     fn verb(&self) -> String;
@@ -312,7 +312,7 @@ impl AuthGetHeader for Auth {
     }
 }
 
-pub trait AuthHeader {
+pub(crate) trait AuthHeader {
     fn from_auth(auth: &impl AuthToHeaderMap) -> OssResult<Self>
     where
         Self: Sized;
@@ -399,7 +399,8 @@ impl SignString {
     pub fn new(data: String, key: KeyId, secret: KeySecret) -> SignString {
         SignString { data, key, secret }
     }
-    pub fn from_auth(
+
+    pub(crate) fn from_auth(
         auth: &impl AuthSignString,
         header: impl HeaderToSign,
     ) -> OssResult<SignString> {
@@ -427,11 +428,13 @@ impl SignString {
         self.data.clone()
     }
 
-    pub fn key_string(&self) -> String {
+    #[cfg(test)]
+    pub(crate) fn key_string(&self) -> String {
         self.key.to_string()
     }
 
-    pub fn secret_string(&self) -> String {
+    #[cfg(test)]
+    pub(crate) fn secret_string(&self) -> String {
         self.secret.to_string()
     }
 
@@ -499,9 +502,10 @@ impl AuthBuilder {
     ///
     /// ```
     /// # use aliyun_oss_client::auth::AuthBuilder;
-    /// let auth = AuthBuilder::default()
+    /// use aliyun_oss_client::auth::AuthGetHeader;
+    /// let headers = AuthBuilder::default()
     ///     .key("bar".into())
-    ///     .build();
+    ///     .get_headers();
     /// ```
     pub fn key(mut self, key: KeyId) -> Self {
         self.auth.set_key(key);
@@ -574,7 +578,8 @@ impl AuthBuilder {
         self
     }
 
-    pub fn build(self) -> Auth {
+    #[allow(dead_code)]
+    pub(crate) fn build(self) -> Auth {
         self.auth
     }
 }

programming_language: Rust
CVE-2021-32610 (published 2021-07-30T14:15Z)

In Archive_Tar before 1.4.14, symlinks can refer to targets outside of the extracted archive, a different vulnerability than CVE-2020-36193.

Severity: LOW
CVSS v2 base score: 3.6 (AV:L/AC:L/Au:N/C:P/I:P/A:N)
CVSS v3 base score: 7.1, HIGH (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N)

Weakness information:
cwe_id: CWE-59
cwe_name: Improper Link Resolution Before File Access ('Link Following')
description: The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
extended_description: 
            
            
         
         

Fix information:
repo_url: https://github.com/pear/Archive_Tar
commit_details: repo_url: https://github.com/pear/Archive_Tar
author: Michiel Rook
author_date: 2021-09-07 09:21:19+02:00
msg: Merge pull request #40 from mcdruid/master

Add tests for symlink security fixes (CVE-2021-32610) [tests + patch by Drew Webber]
repository: repo_url: https://github.com/pear/Archive_Tar
repo_name: pear/Archive_Tar
repo_language: PHP
owner: pear
CVE-2015-0205 (published 2015-01-09T02:59Z)

The ssl3_get_cert_verify function in s3_srvr.c in OpenSSL 1.0.0 before 1.0.0p and 1.0.1 before 1.0.1k accepts client authentication with a Diffie-Hellman (DH) certificate without requiring a CertificateVerify message, which allows remote attackers to obtain access without knowledge of a private key via crafted TLS Handshake Protocol traffic to a server that recognizes a Certification Authority with DH support.

Severity: MEDIUM
CVSS v2 base score: 5.0 (AV:N/AC:L/Au:N/C:N/I:P/A:N)

Weakness information:
cwe_id: CWE-310
cwe_name: Cryptographic Issues
description: Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed.

Fix information:
repo_url: https://github.com/openssl/openssl
commit_details: repo_url: https://github.com/openssl/openssl
author: Dr. Stephen Henson
author_date: 2014-10-23 20:36:17+01:00
msg: Unauthenticated DH client certificate fix.

Fix to prevent use of DH client certificates without sending
certificate verify message.

If we've used a client certificate to generate the premaster secret
ssl3_get_client_key_exchange returns 2 and ssl3_get_cert_verify is
never called.

We can only skip the certificate verify message in
ssl3_get_cert_verify if the client didn't send a certificate.

Thanks to Karthikeyan Bhargavan for reporting this issue.
CVE-2015-0205
Reviewed-by: Matt Caswell <matt@openssl.org>
repository: repo_url: https://github.com/openssl/openssl
repo_name: openssl/openssl
description: TLS/SSL and crypto library
repo_language: C
owner: openssl
file_changes: filename: s3_srvr.c
change_type: ModificationType.MODIFY
diff: @@ -3056,7 +3056,7 @@ int ssl3_get_cert_verify(SSL *s)
 	if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY)
 		{
 		s->s3->tmp.reuse_message=1;
-		if ((peer != NULL) && (type & EVP_PKT_SIGN))
+		if (peer != NULL)
 			{
 			al=SSL_AD_UNEXPECTED_MESSAGE;
 			SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_MISSING_VERIFY_MESSAGE);

programming_language: C
CVE-2022-28044 (published 2022-04-15T14:15Z)

Irzip v0.640 was discovered to contain a heap memory corruption via the component lrzip.c:initialise_control.

Severity: HIGH
CVSS v2 base score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)
CVSS v3 base score: 9.8, CRITICAL (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-787
cwe_name: Out-of-bounds Write
description: The product writes data past the end, or before the beginning, of the intended buffer.
extended_description: 
            
            
             
			 
         
         

Fix information:
repo_url: https://github.com/ckolivas/lrzip
commit_details: repo_url: https://github.com/ckolivas/lrzip
author: Con Kolivas
author_date: 2022-02-25 22:35:20+11:00
msg: Fix control->suffix being deallocated as heap memory as reported by Pietro Borrello.
repository: repo_url: https://github.com/ckolivas/lrzip
repo_name: ckolivas/lrzip
description: Long Range Zip
repo_language: C
owner: ckolivas
file_changes: filename: lrzip.c
change_type: ModificationType.MODIFY
diff: @@ -1338,7 +1338,7 @@ bool initialise_control(rzip_control *control)
 	control->msgerr = stderr;
 	register_outputfile(control, control->msgout);
 	control->flags = FLAG_SHOW_PROGRESS | FLAG_KEEP_FILES | FLAG_THRESHOLD;
-	control->suffix = ".lrz";
+	control->suffix = strdup(".lrz");
 	control->compression_level = 7;
 	control->ramsize = get_ram(control);
 	if (unlikely(control->ramsize == -1))

programming_language: C
filename: main.c
change_type: ModificationType.MODIFY
diff: @@ -458,7 +458,8 @@ int main(int argc, char *argv[])
 			if (unlikely(STDOUT))
 				failure("Cannot specify an output filename when outputting to stdout\n");
 			control->outname = optarg;
-			control->suffix = "";
+			dealloc(control->suffix);
+			control->suffix = strdup("");
 			break;
 		case 'O':
 			if (control->outname)	/* can't mix -o and -O */
@@ -493,7 +494,8 @@ int main(int argc, char *argv[])
 				failure("Specified output filename already, can't specify an extension.\n");
 			if (unlikely(STDOUT))
 				failure("Cannot specify a filename suffix when outputting to stdout\n");
-			control->suffix = optarg;
+			dealloc(control->suffix);
+			control->suffix = strdup(optarg);
 			break;
 		case 't':
 			if (control->outname)

programming_language: C