Skip to content

Commit

Permalink
Remove buffer overflow compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
icraggs committed Oct 2, 2020
1 parent 0722f28 commit 56bdc82
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
48 changes: 24 additions & 24 deletions test/test9.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void test1cOnConnect(void* context, MQTTAsync_successData* response)

int test1dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test1donSubscribe(void* context, MQTTAsync_successData* response)
{
Expand Down Expand Up @@ -426,8 +426,8 @@ int test1(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

sprintf(willTopic, "paho-test9-1-%s", unique);
Expand Down Expand Up @@ -637,7 +637,7 @@ void test2cOnConnect(void* context, MQTTAsync_successData* response)

int test2dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test2donSubscribe(void* context, MQTTAsync_successData* response)
{
Expand Down Expand Up @@ -686,8 +686,8 @@ int test2(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
char *URIs[2] = {"rubbish", options.proxy_connection};

Expand Down Expand Up @@ -907,7 +907,7 @@ void test3cOnConnect(void* context, MQTTAsync_successData* response)

int test3dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test3donSubscribe(void* context, MQTTAsync_successData* response)
{
Expand Down Expand Up @@ -956,8 +956,8 @@ int test3(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

sprintf(willTopic, "paho-test9-3-%s", unique);
Expand Down Expand Up @@ -1165,7 +1165,7 @@ void test4cOnConnect(void* context, MQTTAsync_successData* response)

int test4dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test4donSubscribe(void* context, MQTTAsync_successData* response)
{
Expand Down Expand Up @@ -1214,8 +1214,8 @@ int test4(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
char *URIs[2] = {"rubbish", options.proxy_connection};

Expand Down Expand Up @@ -1424,7 +1424,7 @@ void test5cOnConnect(void* context, MQTTAsync_successData* response)

int test5dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test5donSubscribe(void* context, MQTTAsync_successData* response)
{
Expand Down Expand Up @@ -1471,8 +1471,8 @@ int test5(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

sprintf(willTopic, "paho-test9-5-%s", unique);
Expand Down Expand Up @@ -1626,8 +1626,8 @@ int test6(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

test5_will_message_received = 0;
Expand Down Expand Up @@ -1886,8 +1886,8 @@ int test7(struct Options options)
//MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

test7_will_message_received = 0;
Expand Down Expand Up @@ -2129,8 +2129,8 @@ int test8(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

sprintf(willTopic, "paho-test9-8-%s", unique);
Expand Down Expand Up @@ -2317,7 +2317,7 @@ int test9(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidc[70];
int i = 0;
START_TIME_TYPE start;
int no_buffered_messages = 50000;
Expand Down Expand Up @@ -2492,8 +2492,8 @@ int test10(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

sprintf(willTopic, "paho-test9-10-%s", unique);
Expand Down
40 changes: 20 additions & 20 deletions test/test95.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2018 IBM Corp.
* Copyright (c) 2012, 2020 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
Expand Down Expand Up @@ -434,7 +434,7 @@ void test1cOnConnect(void* context, MQTTAsync_successData5* response)

int test1dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test1donSubscribe(void* context, MQTTAsync_successData5* response)
{
Expand Down Expand Up @@ -484,8 +484,8 @@ int test1(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
MQTTProperties props = MQTTProperties_initializer;
MQTTProperties willProps = MQTTProperties_initializer;
Expand Down Expand Up @@ -759,7 +759,7 @@ void test2cOnConnect(void* context, MQTTAsync_successData5* response)

int test2dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test2donSubscribe(void* context, MQTTAsync_successData5* response)
{
Expand Down Expand Up @@ -809,8 +809,8 @@ int test2(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
char *URIs[2] = {"rubbish", options.proxy_connection};
MQTTProperties props = MQTTProperties_initializer;
Expand Down Expand Up @@ -1031,7 +1031,7 @@ void test3cOnConnect(void* context, MQTTAsync_successData5* response)

int test3dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test3donSubscribe(void* context, MQTTAsync_successData5* response)
{
Expand Down Expand Up @@ -1081,8 +1081,8 @@ int test3(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
MQTTProperties props = MQTTProperties_initializer;
MQTTProperty property;
Expand Down Expand Up @@ -1299,7 +1299,7 @@ void test4cOnConnect(void* context, MQTTAsync_successData5* response)

int test4dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test4donSubscribe(void* context, MQTTAsync_successData5* response)
{
Expand Down Expand Up @@ -1349,8 +1349,8 @@ int test4(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
char *URIs[2] = {"rubbish", options.proxy_connection};
MQTTProperties props = MQTTProperties_initializer;
Expand Down Expand Up @@ -1567,7 +1567,7 @@ void test5cOnConnect(void* context, MQTTAsync_successData5* response)

int test5dReady = 0;
char willTopic[100];
char test_topic[50];
char test_topic[100];

void test5donSubscribe(void* context, MQTTAsync_successData5* response)
{
Expand Down Expand Up @@ -1615,8 +1615,8 @@ int test5(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
MQTTProperties props = MQTTProperties_initializer;
MQTTProperty property;
Expand Down Expand Up @@ -1779,8 +1779,8 @@ int test6(struct Options options)
MQTTAsync_createOptions createOptions = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;
MQTTProperties props = MQTTProperties_initializer;
MQTTProperty property;
Expand Down Expand Up @@ -2049,8 +2049,8 @@ int test7(struct Options options)
MQTTAsync_createOptions createOpts = MQTTAsync_createOptions_initializer;
int rc = 0;
int count = 0;
char clientidc[50];
char clientidd[50];
char clientidc[70];
char clientidd[70];
int i = 0;

test7_will_message_received = 0;
Expand Down

0 comments on commit 56bdc82

Please sign in to comment.