Commit Graph

1836 Commits

Author SHA1 Message Date
Ian Craggs 05ab976ee6 Fix security file text 2024-01-03 15:26:58 +00:00
Ian Craggs 296b19c447 Merge branch 'master' of github.com:eclipse/paho.mqtt.c 2024-01-03 15:21:05 +00:00
Ian Craggs 776838598d Add NOTICE file 2024-01-03 15:19:00 +00:00
Ian Craggs 1b431761e4
Update artifact_linux.yml 2023-10-19 13:01:59 +01:00
Ian Craggs 1fa37e14e6
Update artifact_linux.yml 2023-10-18 12:13:07 +01:00
Ian Craggs 3a4a6f9647
Update artifact_macos.yml 2023-10-18 12:11:02 +01:00
Ian Craggs 07a875788d Merge branch 'develop' 2023-10-13 18:18:52 +01:00
Ian Craggs 8cf971cf16 Update copyright statement date 2023-10-13 18:18:20 +01:00
Ian Craggs 3e83c0273a Update online docs 2023-10-13 18:13:33 +01:00
Ian Craggs b6316dead9 Merge branch 'develop' 2023-10-13 13:09:24 +01:00
Ian Craggs 9ff7f299d9 Update copyright dates in MQTTClient and MQTTAsync docs 2023-10-13 13:08:53 +01:00
Ian Craggs 7c3259a388 Merge branch 'develop' 2023-10-13 13:05:29 +01:00
Ian Craggs dbe66c378c Update version patch level to 13 2023-10-13 13:02:56 +01:00
Ian Craggs 734571997f Doc to note heap must be initialized before calling MQTTProperties_add #1378 2023-10-12 11:27:41 +01:00
Ian Craggs fdb9bea79b Don't allow building of samples without SSL - won't work #1387 2023-10-12 11:18:17 +01:00
Ian Craggs afb5e871ba Rename public Threading functions to avoid clashes #1313 2023-10-10 12:20:56 +01:00
Ian Craggs fa7b8b2d1d Session expiry should be unsigned for 32 bit 2023-10-10 11:37:43 +01:00
Ian Craggs 869e8e6c72 Add MQTTClient_malloc for user defined persistence #1352 2023-10-10 11:36:32 +01:00
Ian Craggs 6b255f0770 Add uuid library if build option set #1319 2023-10-10 11:00:29 +01:00
Michael Bleis aebb8bb6d3 fix(odr): Fix ODR violation for libuuid symbols
Signed-off-by: Michael Bleis <michael.bleis@aracom.de>
2023-10-10 10:44:23 +01:00
Ian Craggs 43a7b48c03
Merge pull request #1382 from CIPop/asyncsamplefix1
Async sample callback context fix.
2023-10-09 14:58:14 +01:00
Ian Craggs 707b0dc1b3 Merge branch 'develop' of github.com:eclipse/paho.mqtt.c into develop 2023-10-09 14:57:04 +01:00
Ian Craggs 0e3cdc75a9
Merge pull request #1398 from CIPop/eclipse_ip_check
Updating the contributing guide regarding IP verification.
2023-10-09 14:55:41 +01:00
Ian Craggs 9fd3e62ab4 Free keys on error #1373 2023-10-09 14:51:37 +01:00
Ian Craggs 67e3eb6062 Revert "fix: MQTTPacket.c read&write Int/Int4 error" #1336
This reverts commit ed07139291.
2023-10-09 14:11:58 +01:00
Ian Craggs d7b8c17c7f OpenSSL thread cleanup #1383 2023-10-05 15:20:40 +01:00
Ian Craggs 77d062327d Check the write value after memory allocation #1392 2023-10-01 15:04:42 +01:00
CIPop 00877b0954 Updating the contributing guide regarding IP verification. 2023-09-20 20:36:13 +00:00
CIPop 4f58560079 Async sample callback context fix. 2023-07-21 18:20:06 +00:00
Ian Craggs 9613cf419c Free some allocated memory under some circumstances 2023-05-25 10:05:14 +01:00
Ian Craggs 5ce322200d Free some allocated test memory 2023-05-25 10:04:48 +01:00
Ian Craggs a9a8ea5619 Lock socket mutex on socket close #1219 2023-05-25 10:04:21 +01:00
Ian Craggs 08132d4cd7 Correct some memory accesses 2023-05-17 17:59:10 +01:00
Ian Craggs 357c392db1 Check cause connectionLost parameter in samples 2023-05-17 12:46:44 +01:00
Ian Craggs fd213a8461 Handle 0 length arrays properly #1356 2023-05-15 15:55:18 +01:00
Ian Craggs 3933f8b796 Change writeInt4 and readInt4 signatures to unsigned #1336 2023-04-27 18:33:02 +01:00
lijinggang ed07139291 fix: MQTTPacket.c read&write Int/Int4 error
readInt
writeInt
readInt4
writeInt4

eg:
writeInt4(0xFFFFFFFF)

Signed-off-by: lijinggang <lijinggang@aliyun.com>
2023-04-27 17:05:54 +01:00
Ian Craggs c2b51d7abf Limit subscribe/unsubscribe interleaving #1334 2023-04-27 15:58:16 +01:00
Ian Craggs 7db2132930 Update Github action Linux build version 2023-04-27 12:39:21 +01:00
Neil Horman f3b1d763b9 Fix read/write race between in MQTTClient
Valgrind reported this error to me recently:

==258178== Invalid read of size 8
==258178==    at 0x3579AB: MQTTClient_waitForCompletion (in /home/nhorman/git/privafy/test/microedge-c/test)
==258178==    by 0x1724BF: publish_msg (comms_connect.c:625)
==258178==    by 0x16F55A: _send_message (comms_register.c:294)
==258178==    by 0x16F605: send_message_sync (comms_register.c:311)
==258178==    by 0x178AEA: send_obj_write_resp_mqtt_message (day0_mqtt_state.c:49)
==258178==    by 0x178FE5: day0_obj_write_req_mqtt_handler (day0_mqtt_state.c:170)
==258178==    by 0x1777A5: service_state_machine_run (service_state_machine_handler.c:670)
==258178==    by 0x49EE12C: start_thread (pthread_create.c:442)
==258178==    by 0x4A6ED73: clone (clone.S:100)
==258178==  Address 0x5075e38 is 24 bytes inside a block of size 152 free'd
==258178==    at 0x48460E4: free (vg_replace_malloc.c:884)
==258178==    by 0x3673FD: ListUnlink (in /home/nhorman/git/privafy/test/microedge-c/test)
==258178==    by 0x3674C0: ListRemove (in /home/nhorman/git/privafy/test/microedge-c/test)
==258178==    by 0x35206D: MQTTClient_destroy (in /home/nhorman/git/privafy/test/microedge-c/test)
==258178==    by 0x171BBD: comms_run (comms_connect.c:445)
==258178==    by 0x49EE12C: start_thread (pthread_create.c:442)
==258178==    by 0x4A6ED73: clone (clone.S:100)
==258178==  Block was alloc'd at
==258178==    at 0x484386F: malloc (vg_replace_malloc.c:393)
==258178==    by 0x351A96: MQTTClient_createWithOptions (in /home/nhorman/git/privafy/test/microedge-c/test)
==258178==    by 0x171987: comms_run (comms_connect.c:409)
==258178==    by 0x49EE12C: start_thread (pthread_create.c:442)
==258178==    by 0x4A6ED73: clone (clone.S:100)

Its occuring because, in MQTTClient_waitForCompletion, the
mqttclient_mutex is repeatedly dropped and re-aquired.  While thats fine
to do, it creates the possibility for another thread to run between the
time MQTClient_waitForCompletion calls MQTTClient_yield and the time it
reaquires the lock.  Valgrind notes that during that period, if another
thread calls MQTTCilent_destroy, the value of m->c in
MQTTClient_waitForCompletion will change, triggering the above invalid
read warning.

Fix is pretty easy, just move the if (m == NULL || m->c == NULL)
conditional to inside the while loop, so that the value of m->c is
revalidated after each lock re-aquisition.

Signed-off-by: Neil Horman <nhorman@gmail.com>
2023-04-26 16:49:12 +01:00
Ian Craggs 663da861d1 Update expired TLS certificates 2023-04-26 16:02:51 +01:00
Ian Craggs ade43fbd9e Don't call websocket_connect twice #1348 2023-04-16 13:05:58 +01:00
Ian Craggs b585c1f41e Correct behaviour when settings changed in the connectionLost callback #1341 2023-04-16 12:43:39 +01:00
Ian Craggs d46de46e5b Update Github action Linux build version 2023-04-14 11:55:11 +01:00
Ian Craggs 153b0a2ef5 Merge branch 'develop' of github.com:eclipse/paho.mqtt.c into develop 2023-04-13 16:08:56 +01:00
Ian Craggs f8c1e0dbed Update expired TLS certificates 2023-04-13 15:55:13 +01:00
Ian Craggs 3b03bebb70 Correct script name #1273 2023-01-31 12:47:47 +13:00
Ian Craggs 8f017d7d10 Update version numbers 2022-12-21 11:32:41 +00:00
Ian Craggs f7799da95e Update version numbers 2022-12-21 11:29:53 +00:00
Ian Craggs 4157a27d39 Merge branch 'develop' 2022-12-21 09:40:14 +00:00