| 39 | *----------------------------------------------------------------------------*/ |
| 40 | |
| 41 | static int checkStringLength(client *c, long long size, long long append) { |
| 42 | if (c->flags & CLIENT_MASTER) |
| 43 | return C_OK; |
| 44 | /* 'uint64_t' cast is there just to prevent undefined behavior on overflow */ |
| 45 | long long total = (uint64_t)size + append; |
| 46 | /* Test configured max-bulk-len represending a limit of the biggest string object, |
| 47 | * and also test for overflow. */ |
| 48 | if (total > g_pserver->proto_max_bulk_len || total < size || total < append) { |
| 49 | addReplyError(c,"string exceeds maximum allowed size (proto-max-bulk-len)"); |
| 50 | return C_ERR; |
| 51 | } |
| 52 | return C_OK; |
| 53 | } |
| 54 | |
| 55 | /* The setGenericCommand() function implements the SET operation with different |
| 56 | * options and variants. This function is called in order to implement the |
no test coverage detected